目前我正在使用触发以下方法的 cron 作业重新启动我的 sidekiq 作业
class RestartSidekiqJobs
require 'sidekiq/api'
class << self
def restart_jobs
Sidekiq::ScheduledSet.new.clear
channels = Channel.all
channels.each do |channel|
FetchMoreDataJob.perform_later(channel: channel)
end
end
end
end
但是,我不相信这是处理此问题的最佳方法,因此我想我会看看是否有更好的解决方案。