mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Use defer, fixes #398
This commit is contained in:
parent
d3dcffd056
commit
8343fe0039
3 changed files with 14 additions and 11 deletions
|
@ -1,6 +1,7 @@
|
|||
2.3.1
|
||||
-----------
|
||||
|
||||
- Re-enable Celluloid::Actor#defer to fix stack overflow issues [#398]
|
||||
- Add support for multiple processes per host to Capistrano recipe
|
||||
|
||||
2.3.0
|
||||
|
|
|
@ -32,19 +32,21 @@ module Sidekiq
|
|||
end
|
||||
|
||||
def process(msgstr, queue)
|
||||
begin
|
||||
msg = Sidekiq.load_json(msgstr)
|
||||
klass = constantize(msg['class'])
|
||||
worker = klass.new
|
||||
defer do
|
||||
begin
|
||||
msg = Sidekiq.load_json(msgstr)
|
||||
klass = constantize(msg['class'])
|
||||
worker = klass.new
|
||||
|
||||
stats(worker, msg, queue) do
|
||||
Sidekiq.server_middleware.invoke(worker, msg, queue) do
|
||||
worker.perform(*cloned(msg['args']))
|
||||
stats(worker, msg, queue) do
|
||||
Sidekiq.server_middleware.invoke(worker, msg, queue) do
|
||||
worker.perform(*cloned(msg['args']))
|
||||
end
|
||||
end
|
||||
rescue Exception => ex
|
||||
handle_exception(ex, msg || { :message => msgstr })
|
||||
raise
|
||||
end
|
||||
rescue Exception => ex
|
||||
handle_exception(ex, msg || { :message => msgstr })
|
||||
raise
|
||||
end
|
||||
@boss.processor_done!(current_actor)
|
||||
end
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module Sidekiq
|
||||
VERSION = "2.3.0"
|
||||
VERSION = "2.3.1"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue