Skip to content

Commit 0400ab0

Browse files
committed
fix: correct thread-pool mutex logic which was causing a deadlock
1 parent 3899855 commit 0400ab0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/graphiti/scope.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ def self.thread_pool_executor
99
return @thread_pool_executor if @thread_pool_executor
1010

1111
concurrency = Graphiti.config.concurrency_max_threads || 4
12-
@thread_pool_executor_mutex.synchronize do
13-
@thread_pool_executor ||= Concurrent::ThreadPoolExecutor.new(
12+
@thread_pool_executor ||= @thread_pool_executor_mutex.synchronize do
13+
Concurrent::ThreadPoolExecutor.new(
1414
min_threads: 0,
1515
max_threads: concurrency,
1616
max_queue: concurrency * 4,

0 commit comments

Comments
 (0)