Created
September 10, 2018 10:38
-
-
Save stefanahman/fa8b63f389e4f065e3c7910bcb42d3d4 to your computer and use it in GitHub Desktop.
Remove jobs from Resque queues
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Active job | |
queue_name = 'netsuite_low' | |
class_name = 'PurchaseOrder::ImportSingleFromNetsuiteJob' | |
active_job_class = 'ActiveJob::QueueAdapters::ResqueAdapter::JobWrapper' | |
# active_job_class = 'ActiveScheduler::ResqueWrapper' | |
args = Resque.peek(queue_name,0,10000).select { |job| job['args'].to_s.include?(class_name) }.flat_map{ |job| job['args'] }; nil | |
args.each { |arg| Resque::Job.destroy(queue_name, active_job_class, arg) }; nil | |
# Resque | |
queue_name = 'netsuite' | |
class_name = 'ImportSingleWardJob' | |
args = Resque.peek(queue_name,0,10000).select { |job| job['class'].to_s.include?(class_name) }.map{ |job| job['args'] }; nil | |
args.each { |arg| Resque::Job.destroy(queue_name, class_name, *arg) }; nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment