Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling/scheduling sidekiq worker from them selves

Is there any other way to reschedule sidekiq worker than calling perform_in or perform_at from their own perform method?

Is this viable?

class TestWorker
  include Sidekiq::Worker
  sidekiq_options retry: false


  def perform
    if something
      TestWorker.perform_in(14.days)
    end
  end

end
like image 635
Matjaz Muhic Avatar asked Jul 17 '14 19:07

Matjaz Muhic


1 Answers

Yes, it's perfectly normal to reschedule a job from itself.

like image 166
Mike Perham Avatar answered Oct 13 '22 03:10

Mike Perham