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
|
2.3.1
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
- Re-enable Celluloid::Actor#defer to fix stack overflow issues [#398]
|
||||||
- Add support for multiple processes per host to Capistrano recipe
|
- Add support for multiple processes per host to Capistrano recipe
|
||||||
|
|
||||||
2.3.0
|
2.3.0
|
||||||
|
|
|
@ -32,19 +32,21 @@ module Sidekiq
|
||||||
end
|
end
|
||||||
|
|
||||||
def process(msgstr, queue)
|
def process(msgstr, queue)
|
||||||
begin
|
defer do
|
||||||
msg = Sidekiq.load_json(msgstr)
|
begin
|
||||||
klass = constantize(msg['class'])
|
msg = Sidekiq.load_json(msgstr)
|
||||||
worker = klass.new
|
klass = constantize(msg['class'])
|
||||||
|
worker = klass.new
|
||||||
|
|
||||||
stats(worker, msg, queue) do
|
stats(worker, msg, queue) do
|
||||||
Sidekiq.server_middleware.invoke(worker, msg, queue) do
|
Sidekiq.server_middleware.invoke(worker, msg, queue) do
|
||||||
worker.perform(*cloned(msg['args']))
|
worker.perform(*cloned(msg['args']))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
rescue Exception => ex
|
||||||
|
handle_exception(ex, msg || { :message => msgstr })
|
||||||
|
raise
|
||||||
end
|
end
|
||||||
rescue Exception => ex
|
|
||||||
handle_exception(ex, msg || { :message => msgstr })
|
|
||||||
raise
|
|
||||||
end
|
end
|
||||||
@boss.processor_done!(current_actor)
|
@boss.processor_done!(current_actor)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
module Sidekiq
|
module Sidekiq
|
||||||
VERSION = "2.3.0"
|
VERSION = "2.3.1"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue