Trying to implement some kind of cancel job functionality. In order to destroy a job with Resque, one needs the specific arguments passed to it. It appears I'm passing in unintended information by mistake though.
I'm expecting just the arguments value to be within the outside brackets. I'm creating the job like so:
Resque::Job.destroy(:default, PhysicalServerProvisionJob, '123')
With help from this answer here, I solved the problem this way:
Resque.size('default').times do job = Resque.reserve('default') next if job.nil? || job.args.first['arguments'].first == id Resque.push('default', class: job.payload_class.to_s, args: job.args) end