File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
cloudnet-rest-module/src/main/java/eu/cloudnetservice/ext/modules/rest/config Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 26
26
import eu .cloudnetservice .ext .rest .api .connection .HttpConnectionInfoResolver ;
27
27
import eu .cloudnetservice .ext .rest .api .util .HostAndPort ;
28
28
import java .util .List ;
29
- import java .util .concurrent .Executors ;
29
+ import java .util .concurrent .LinkedBlockingQueue ;
30
+ import java .util .concurrent .ThreadPoolExecutor ;
31
+ import java .util .concurrent .TimeUnit ;
30
32
import lombok .NonNull ;
31
33
import org .jetbrains .annotations .Nullable ;
32
34
@@ -78,14 +80,22 @@ public void validate() {
78
80
.setPriority (Thread .NORM_PRIORITY )
79
81
.setNameFormat ("rest-request-dispatcher-%d" )
80
82
.build ();
83
+ var requestDispatchExecutor = new ThreadPoolExecutor (
84
+ 1 ,
85
+ this .requestDispatchThreadLimit ,
86
+ 30L ,
87
+ TimeUnit .SECONDS ,
88
+ new LinkedBlockingQueue <>(),
89
+ requestDispatchThreadFactory );
90
+
81
91
return ComponentConfig .builder ()
82
92
.corsConfig (this .corsConfig )
83
93
.haProxyMode (this .proxyMode )
84
94
.maxContentLength (this .maxContentLength )
85
95
.sslConfiguration (this .sslConfiguration )
96
+ .executorService (requestDispatchExecutor )
86
97
.disableNativeTransport (this .disableNativeTransport )
87
98
.connectionInfoResolver (this .httpConnectionInfoResolver ())
88
- .executorService (Executors .newFixedThreadPool (this .requestDispatchThreadLimit , requestDispatchThreadFactory ))
89
99
.build ();
90
100
}
91
101
You can’t perform that action at this time.
0 commit comments