Skip to content

Commit

Permalink
When override workQueue for the controller should shutdown the origin…
Browse files Browse the repository at this point in the history
…al queue incase thread leakage
  • Loading branch information
yuzp1996 committed Oct 12, 2024
1 parent 471ed26 commit e8b2fbe
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ public DefaultControllerBuilder withName(String controllerName) {
* @return the controller builder
*/
public DefaultControllerBuilder withWorkQueue(RateLimitingQueue<Request> workQueue) {
if (this.workQueue != null && !this.workQueue.isShuttingDown()){
this.workQueue.shutdown();
}
this.workQueue = workQueue;
return this;
}
Expand Down

0 comments on commit e8b2fbe

Please sign in to comment.