Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个 Rails 应用程序,其中有一段依赖于时区的代码。
如何让我的 Sidekiq 工作人员只在某个时区的白天工作,即每天工作一段时间。
即使它的队列不为空,工作人员也应该在某个时间点(一天结束)暂停并在第二天恢复。
I suggest starting a Cron Job, using the whenever gem that stops the Sidekiq workers at a certain time, and starts them again at a certain time.
You can stop sidekiq workers via sidekiqctl: sidekiqctl stop [pidfile] 60