Skip to content

Commit 0c0177b

Browse files
committed
Merge pull request #239 from SebastianEdwards/patch-1
Prune thread pool only after handling request.
2 parents 9170b5b + 9d9520e commit 0c0177b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/concurrent/executor/ruby_thread_pool_executor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,13 @@ def on_worker_exit(worker)
158158

159159
# @!visibility private
160160
def execute(*args, &task)
161-
prune_pool
162161
if ensure_capacity?
163162
@scheduled_task_count += 1
164163
@queue << [args, task]
165164
else
166165
handle_fallback(*args, &task) if @max_queue != 0 && @queue.length >= @max_queue
167166
end
167+
prune_pool
168168
end
169169

170170
# @!visibility private

0 commit comments

Comments
 (0)