Skip to content

Commit

Permalink
fix behaviour for default executor
Browse files Browse the repository at this point in the history
With zero corePoolSize and unlimited queue it doesn't increase the pool size and it keep using one single thread. If the intention was an unlimited queue with limited thread usage and keepAlive functionality with zero minimal thread then this change looks right for that.
  • Loading branch information
tamasjung committed Jan 3, 2023
1 parent f5f08b4 commit 70100fd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/com/walmartlabs/lacinia/schema.clj
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@
(^Thread newThread [_ ^Runnable runnable]
(Thread. runnable
(format "GraphQL Executor #%d" (swap! *thread-id inc)))))]
(ThreadPoolExecutor. (int 0) (int 10)
1 TimeUnit/SECONDS
queue
factory)))
(doto
(ThreadPoolExecutor. (int 10) (int 10)
1 TimeUnit/SECONDS
queue
factory)
(.allowCoreThreadTimeOut true))))

(def ^:private graphql-identifier #"(?ix) _* [a-z] [a-z0-9_]*")

Expand Down

0 comments on commit 70100fd

Please sign in to comment.