Skip to content

Instantly share code, notes, and snippets.

@bhaskar-f22
Last active July 19, 2021 14:28
Show Gist options
  • Save bhaskar-f22/59854472ebd10c654cb0a60b3fb0907d to your computer and use it in GitHub Desktop.
Save bhaskar-f22/59854472ebd10c654cb0a60b3fb0907d to your computer and use it in GitHub Desktop.
This script is useful to kill running sidekiq jobs with particular class name
queue = Sidekiq::Queue.new("practice_fusion")
queue.each do |job|
job.delete if job.klass == 'PracticeFusionWorkers::PatientDocumentsSyncer'
end
# Way 2
ss = Sidekiq::ScheduledSet.new
jobs = ss.select {|job| job.klass == 'PracticeFusionWorkers::PatientDocumentsSyncer' }
jobs.each(&:delete)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment