Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to re-schedule job at specific time #108

Closed
lksv opened this issue Sep 4, 2015 · 2 comments
Closed

unable to re-schedule job at specific time #108

lksv opened this issue Sep 4, 2015 · 2 comments

Comments

@lksv
Copy link

lksv commented Sep 4, 2015

In worker, I would like to postpone processing of job for some period of time.

e.g.:

class DocumentPlainTextWorker
  include Sidekiq::Worker
  sidekiq_options unique: true, queue: 'plain_text_getter'

  EXTERNAL_TIME_TO_OCR = 2.hours

  def perform(document_id)
    document = Document.lock.find(document_id)
    return if document.already_processed?

    document.text_storage = Dragonfly.app.fetch_url(document.external_ocr_result_url)
    max_time = document.created_at + EXTERNAL_TIME_TO_OCR
    if !document.already_processed? && (max_time > Time.now)
      self.class.perform_at(max_time)
      return
    end

    ...make my own ocr here...
end

The problem is that the option "uniq" deny of creating same task later.

...maybe this is a new feature or just wandering how to do it with uniq:true option.

@mhenrixon
Copy link
Owner

mhenrixon commented Sep 4, 2015 via email

@mhenrixon
Copy link
Owner

Should be fixed in 4.0.0; report back if not!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants