From c3c0dd1a93591a28827441f3c5c5520899091ebf Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Sun, 29 Apr 2012 13:22:39 -0700 Subject: [PATCH] Clean up client option merging --- lib/sidekiq/client.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/sidekiq/client.rb b/lib/sidekiq/client.rb index 45d1295e..af62b77a 100644 --- a/lib/sidekiq/client.rb +++ b/lib/sidekiq/client.rb @@ -41,16 +41,10 @@ module Sidekiq worker_class = item['class'] item['class'] = item['class'].to_s - item['retry'] = !!worker_class.get_sidekiq_options['retry'] - queue = item['queue'] || worker_class.get_sidekiq_options['queue'] || 'default' - if !item['backtrace'] && worker_class.get_sidekiq_options['backtrace'] - item['backtrace'] = worker_class.get_sidekiq_options['backtrace'] - end - - if !item['timeout'] && worker_class.get_sidekiq_options['timeout'] - item['timeout'] = worker_class.get_sidekiq_options['timeout'] - end + item = worker_class.get_sidekiq_options.merge(item) + item['retry'] = !!item['retry'] + queue = item['queue'] pushed = false Sidekiq.client_middleware.invoke(worker_class, item, queue) do