a guest Feb 23rd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Sidekiq::SidekiqDequer
  2.     include Sidekiq
  3.     def delete_job_x (worker_name,arguments)
  4.       old_jobs = do |job|
  5.         job.klass == worker_name && job.args == [arguments]
  6.       end
  7.       old_jobs.each(&:delete)
  8.     end
  9. end
  10. #Usage
  11. #include  Sidekiq::SidekiqDequer
  12. #in your Model/Controller ( Call delete_job_x("The Worker Class Name", Number of Arguments)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand