Skip to content

Commit dd7a38e

Browse files
committed
Add back thread observer
1 parent 01d2f80 commit dd7a38e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/solid_queue/pool.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ def post(execution)
1919
available_threads.decrement
2020

2121
future = Concurrent::Future.new(args: [ execution ], executor: executor) do |thread_execution|
22-
begin
23-
wrap_in_app_executor do
24-
thread_execution.perform
25-
end
26-
rescue Exception
27-
nil
28-
ensure
29-
available_threads.increment
30-
mutex.synchronize { on_idle.try(:call) if idle? }
22+
wrap_in_app_executor do
23+
thread_execution.perform
3124
end
25+
ensure
26+
available_threads.increment
27+
mutex.synchronize { on_idle.try(:call) if idle? }
28+
end
29+
30+
future.add_observer do |_, _, error|
31+
handle_thread_error(error) if error
3232
end
3333

3434
future.execute

0 commit comments

Comments
 (0)