From 8cdd5d95fc7d6d778a1a3fa46c627513d4f36823 Mon Sep 17 00:00:00 2001 From: Avdi Grimm Date: Fri, 7 Jun 2013 14:59:08 -0400 Subject: [PATCH] Clarify job args dissection using destructuring assignment. --- lib/jobs.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/jobs.rb b/lib/jobs.rb index 8397b88ce8a..2ed86e1830c 100644 --- a/lib/jobs.rb +++ b/lib/jobs.rb @@ -113,10 +113,11 @@ module Jobs Sidekiq::ScheduledSet.new.select do |scheduled_job| if scheduled_job.klass == 'Sidekiq::Extensions::DelayedClass' 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 params.each do |key, value| - unless job_args[2][0][key] == value + unless job_args_params[key] == value matched = false break end