Skip to content

Commit

Permalink
Merge branch 'master' into feature/generalized-start-script
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Chekaluk committed Jan 3, 2014
2 parents 3e9d40c + ef90528 commit e353f10
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2.17.2
-----------

- Fix race condition in bulk requeue during shutdown [#1406]
- Fix bug where strictly prioritized queues might be processed out of
order [#1408]

2.17.1
-----------

Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/middleware/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def call(worker, msg, queue)
I18n.locale = msg['locale'] || I18n.default_locale
yield
ensure
I18n.locale = nil
I18n.locale = I18n.default_locale
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Sidekiq
VERSION = "2.17.1"
VERSION = "2.17.2"
end
16 changes: 15 additions & 1 deletion test/test_middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,27 @@ def call(*args)
assert_equal :fr, msg['locale']

msg['locale'] = 'jp'
I18n.locale = nil
I18n.locale = I18n.default_locale
assert_equal :en, I18n.locale
mw = Sidekiq::Middleware::I18n::Server.new
mw.call(nil, msg, nil) do
assert_equal :jp, I18n.locale
end
assert_equal :en, I18n.locale
end

it 'supports I18n.enforce_available_locales = true' do
I18n.enforce_available_locales = true
I18n.available_locales = [:en, :jp]

msg = { 'locale' => 'jp' }
mw = Sidekiq::Middleware::I18n::Server.new
mw.call(nil, msg, nil) do
assert_equal :jp, I18n.locale
end

I18n.enforce_available_locales = nil
I18n.available_locales = nil
end
end
end

0 comments on commit e353f10

Please sign in to comment.