mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Stringify Sidekiq.default_worker_options's keys, fix #2124
This commit is contained in:
parent
51b846b077
commit
33b9999c43
3 changed files with 14 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
HEAD
|
||||
-----------
|
||||
- Stringify Sidekiq.default_worker_options's keys [#]
|
||||
- Add random integer to process identity [#2113, michaeldiscala]
|
||||
- Log Sidekiq Pro's Batch ID if available [#2076]
|
||||
- Refactor Processor Redis usage to avoid redis/redis-rb#490 [#]
|
||||
|
|
|
@ -97,7 +97,7 @@ module Sidekiq
|
|||
end
|
||||
|
||||
def self.default_worker_options=(hash)
|
||||
@default_worker_options = default_worker_options.merge(hash)
|
||||
@default_worker_options = default_worker_options.merge(hash).stringify_keys!
|
||||
end
|
||||
|
||||
def self.default_worker_options
|
||||
|
|
|
@ -54,4 +54,16 @@ class TestSidekiq < Sidekiq::Test
|
|||
assert_equal 2, Sidekiq.options[:lifecycle_events][:startup].first.call
|
||||
end
|
||||
end
|
||||
|
||||
describe 'default_worker_options' do
|
||||
before do
|
||||
@old_options = Sidekiq.default_worker_options
|
||||
end
|
||||
after { Sidekiq.default_worker_options = @old_options }
|
||||
|
||||
it 'stringify keys' do
|
||||
Sidekiq.default_worker_options = { queue: 'cat'}
|
||||
assert_equal 'cat', Sidekiq.default_worker_options['queue']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue