Skip to content

Instantly share code, notes, and snippets.


Tobias Flühmann tfluehmann

Block or report user

Report or block tfluehmann

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tfluehmann / reschedule jobs
Last active Jun 22, 2016
reschedule sidekiq cron jobs
View reschedule jobs
scheduled_jobs = YAML.load_file('schedule.yml')
existing_jobs = Sidekiq::Cron::Job.all
existing_jobs.delete_if{|job| !^my_pattern\_/)}
existing_jobs.each do |job|
queue = job.instance_variable_get(:@queue)
new_hash = {class: job.klass, cron: job.cron, description: job.description, args: job.args, status: job.status, queue: queue}
scheduled_jobs[] = new_hash
Sidekiq::Cron::Job.load_from_hash!(scheduled_jobs )
You can’t perform that action at this time.