Merge pull request #985 from avdi/clarify-jobs-dissection
Clarify job args dissection using destructuring assignment.
This commit is contained in:
commit
63c0c59114
|
@ -113,10 +113,11 @@ module Jobs
|
||||||
Sidekiq::ScheduledSet.new.select do |scheduled_job|
|
Sidekiq::ScheduledSet.new.select do |scheduled_job|
|
||||||
if scheduled_job.klass == 'Sidekiq::Extensions::DelayedClass'
|
if scheduled_job.klass == 'Sidekiq::Extensions::DelayedClass'
|
||||||
job_args = YAML.load(scheduled_job.args[0])
|
job_args = YAML.load(scheduled_job.args[0])
|
||||||
if job_args[0].to_s == job_class and job_args[2] and job_args[2][0]
|
job_args_class, _, (job_args_params, *) = job_args
|
||||||
|
if job_args_class.to_s == job_class && job_args_params
|
||||||
matched = true
|
matched = true
|
||||||
params.each do |key, value|
|
params.each do |key, value|
|
||||||
unless job_args[2][0][key] == value
|
unless job_args_params[key] == value
|
||||||
matched = false
|
matched = false
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue