From e832145833083692c190b7895238921ab0db090c Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Fri, 6 Apr 2012 11:26:16 -0700 Subject: [PATCH] Use Celluloid's thread pool for #perform to get a full thread stack, fixes #115 --- lib/sidekiq/processor.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/sidekiq/processor.rb b/lib/sidekiq/processor.rb index 61f6f19c..701986ea 100644 --- a/lib/sidekiq/processor.rb +++ b/lib/sidekiq/processor.rb @@ -30,9 +30,11 @@ module Sidekiq def process(msg, queue) klass = constantize(msg['class']) worker = klass.new - stats(worker, msg, queue) do - Sidekiq.server_middleware.invoke(worker, msg, queue) do - worker.perform(*msg['args']) + defer do + stats(worker, msg, queue) do + Sidekiq.server_middleware.invoke(worker, msg, queue) do + worker.perform(*msg['args']) + end end end @boss.processor_done!(current_actor)