Skip to content

Commit 221e6d9

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

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/solid_queue/pool.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ 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
22+
wrap_in_app_executor do
23+
thread_execution.perform
2824
ensure
2925
available_threads.increment
3026
mutex.synchronize { on_idle.try(:call) if idle? }
3127
end
3228
end
3329

30+
future.add_observer do |_, _, error|
31+
handle_thread_error(error) if error
32+
end
33+
3434
future.execute
3535
end
3636

0 commit comments

Comments
 (0)