Skip to content

Commit 7f7940a

Browse files
committed
repair concurrency
1 parent 6971d2f commit 7f7940a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<modelVersion>4.0.0</modelVersion>
1919
<artifactId>http-server</artifactId>
20-
<version>0.1.24</version>
20+
<version>0.1.25</version>
2121
<name>HttpServer</name>
2222
<packaging>jar</packaging>
2323

src/main/java/info/unterrainer/commons/httpserver/HttpServer.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ private HttpServer(final String configPrefix, final String applicationName, fina
7676
this.appVersionFqns = new ArrayList<>(List.of(Optional.ofNullable(appVersionFqns).orElse(new String[0])));
7777
if (!this.appVersionFqns.contains(VERSION_FQN))
7878
this.appVersionFqns.add(VERSION_FQN);
79-
if (executorService == null)
80-
this.executorService = new ThreadPoolExecutor(1, 200, 0L, TimeUnit.MILLISECONDS,
79+
if (executorService == null) {
80+
this.executorService = new ThreadPoolExecutor(200, 200, 100L, TimeUnit.MILLISECONDS,
8181
new LinkedBlockingQueue<Runnable>());
82+
((ThreadPoolExecutor) this.executorService).allowCoreThreadTimeOut(true);
83+
}
8284
if (applicationName == null)
8385
throw new IllegalArgumentException("The application-name cannot be null");
8486
this.jsonMapper = jsonMapper;

0 commit comments

Comments
 (0)