Fix the test run.
This commit is contained in:
parent
4d0c5f5c18
commit
251baca8e2
3 changed files with 14 additions and 6 deletions
|
@ -27,7 +27,8 @@ import java.net.InetSocketAddress;
|
|||
import java.net.URISyntaxException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.SynchronousQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Function;
|
||||
|
@ -37,7 +38,13 @@ public class LabyrinthServer {
|
|||
@NonNull
|
||||
private final HttpServer httpServer;
|
||||
@NonNull
|
||||
private final ExecutorService executorService = Executors.newCachedThreadPool();
|
||||
private final ExecutorService executorService = new ThreadPoolExecutor(
|
||||
0,
|
||||
1_000,
|
||||
5,
|
||||
TimeUnit.SECONDS,
|
||||
new SynchronousQueue<>()
|
||||
);
|
||||
|
||||
public LabyrinthServer(@NonNull final ServerConfig config) throws IOException, URISyntaxException {
|
||||
this.httpServer = HttpServer.create(new InetSocketAddress(config.getAddress(), config.getPort()), 5);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue