mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Upgrade to Celluloid 0.14, remove defer usage, fixes #919
This commit is contained in:
parent
55726ca900
commit
5db5c938ac
5 changed files with 25 additions and 23 deletions
|
@ -1,6 +1,9 @@
|
|||
2.11.3
|
||||
2.12.0
|
||||
-----------
|
||||
|
||||
- Upgrade to Celluloid 0.14, remove the use of Celluloid's thread
|
||||
pool. This should halve the number of threads in each Sidekiq
|
||||
process, thus requiring less resources. [#919]
|
||||
- Abstract Celluloid usage to Sidekiq::Actor for testing purposes.
|
||||
- Better handling for Redis downtime when fetching jobs and shutting
|
||||
down, don't print exceptions every second and print success message
|
||||
|
|
1
Gemfile
1
Gemfile
|
@ -1,7 +1,6 @@
|
|||
source 'http://rubygems.org'
|
||||
gemspec
|
||||
|
||||
gem 'celluloid', "~> 0.13.0"
|
||||
gem 'slim'
|
||||
gem 'sqlite3', :platform => :mri
|
||||
|
||||
|
|
|
@ -34,29 +34,29 @@ module Sidekiq
|
|||
def process(work)
|
||||
msgstr = work.message
|
||||
queue = work.queue_name
|
||||
defer do
|
||||
@actual_work_thread = Thread.current
|
||||
begin
|
||||
msg = Sidekiq.load_json(msgstr)
|
||||
klass = msg['class'].constantize
|
||||
worker = klass.new
|
||||
worker.jid = msg['jid']
|
||||
|
||||
stats(worker, msg, queue) do
|
||||
Sidekiq.server_middleware.invoke(worker, msg, queue) do
|
||||
worker.perform(*cloned(msg['args']))
|
||||
end
|
||||
@actual_work_thread = Thread.current
|
||||
begin
|
||||
msg = Sidekiq.load_json(msgstr)
|
||||
klass = msg['class'].constantize
|
||||
worker = klass.new
|
||||
worker.jid = msg['jid']
|
||||
|
||||
stats(worker, msg, queue) do
|
||||
Sidekiq.server_middleware.invoke(worker, msg, queue) do
|
||||
worker.perform(*cloned(msg['args']))
|
||||
end
|
||||
rescue Sidekiq::Shutdown
|
||||
# Had to force kill this job because it didn't finish
|
||||
# within the timeout.
|
||||
rescue Exception => ex
|
||||
handle_exception(ex, msg || { :message => msgstr })
|
||||
raise
|
||||
ensure
|
||||
work.acknowledge
|
||||
end
|
||||
rescue Sidekiq::Shutdown
|
||||
# Had to force kill this job because it didn't finish
|
||||
# within the timeout.
|
||||
rescue Exception => ex
|
||||
handle_exception(ex, msg || { :message => msgstr })
|
||||
raise
|
||||
ensure
|
||||
work.acknowledge
|
||||
end
|
||||
|
||||
@boss.async.processor_done(current_actor)
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module Sidekiq
|
||||
VERSION = "2.11.3"
|
||||
VERSION = "2.12.0"
|
||||
end
|
||||
|
|
|
@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|||
gem.add_dependency 'redis', '>= 3.0'
|
||||
gem.add_dependency 'redis-namespace'
|
||||
gem.add_dependency 'connection_pool', '>= 1.0.0'
|
||||
gem.add_dependency 'celluloid', '>= 0.13.0'
|
||||
gem.add_dependency 'celluloid', '>= 0.14.0'
|
||||
gem.add_dependency 'multi_json'
|
||||
gem.add_development_dependency 'sinatra'
|
||||
gem.add_development_dependency 'slim'
|
||||
|
|
Loading…
Reference in a new issue