Search code examples
delayed-jobsidekiq

sidekiq delayed a job in millisecond or other unit of time?


I find in official doc exemple like: https://github.com/mperham/sidekiq/wiki/Scheduled-Jobs

MyWorker.perform_in(3.hours, 'mike', 1)
MyWorker.perform_at(3.hours.from_now, 'mike', 1)

I want to know where and how change the definition of units of time used?

If I want Scheduled a job in millisecond or microsecond, it's possible? how? What is the smallest unit of time can I use?


Solution

  • The unit is float, so you can say perform_in(3.5.seconds, ...). That won't do you much good though because Sidekiq's scheduler is not meant to be precise.

    https://github.com/mperham/sidekiq/wiki/Scheduled-Jobs#checking-for-new-jobs