Skip to content

Commit 6aad429

Browse files
committed
Restoring use of queued thread pool in the hub
1 parent 211989b commit 6aad429

File tree

1 file changed

+8
-6
lines changed
  • java/server/src/org/openqa/grid/web

1 file changed

+8
-6
lines changed

java/server/src/org/openqa/grid/web/Hub.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import org.seleniumhq.jetty9.server.Server;
3939
import org.seleniumhq.jetty9.server.ServerConnector;
4040
import org.seleniumhq.jetty9.servlet.ServletContextHandler;
41+
import org.seleniumhq.jetty9.util.thread.QueuedThreadPool;
4142

4243
import java.net.MalformedURLException;
4344
import java.net.URL;
@@ -106,7 +107,13 @@ public Hub(GridHubConfiguration config) {
106107

107108
private void initServer() {
108109
try {
109-
server = new Server();
110+
if (maxThread>0){
111+
QueuedThreadPool pool = new QueuedThreadPool();
112+
pool.setMaxThreads(maxThread);
113+
server = new Server(pool);
114+
} else {
115+
server = new Server();
116+
}
110117

111118
HttpConfiguration httpConfig = new HttpConfiguration();
112119
httpConfig.setSecureScheme("https");
@@ -182,11 +189,6 @@ public String getHost() {
182189

183190
public void start() throws Exception {
184191
initServer();
185-
// if (maxThread>0){
186-
// QueuedThreadPool pool = new QueuedThreadPool();
187-
// pool.setMaxThreads(maxThread);
188-
// server.setThreadPool(pool);
189-
// }
190192
server.start();
191193
}
192194

0 commit comments

Comments
 (0)