Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: remove default value for runserver cli threads arg #7071

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions core/src/main/java/fr/sncf/osrd/cli/ApiServerCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public final class ApiServerCommand implements CliCommand {
@Parameter(
names = {"-j", "--threads"},
description = "The number of threads to serve requests from")
private int threads = 4;
private Integer threads;

private String getEditoastUrl() {
if (editoastUrl == null) {
Expand Down Expand Up @@ -108,7 +108,8 @@ public int run() {
new FbStatus(404, new RsWithStatus(new RsText("Not found"), 404)), new FbSentry());

var serverConfig = new TkSlf4j(new TkFallback(monitoredRoutes, fallbacks));
var serverBack = new BkParallel(new BkSafe(new BkBasic(serverConfig)), threads);
var serverSafety = new BkSafe(new BkBasic(serverConfig));
var serverBack = threads != null ? new BkParallel(serverSafety, threads) : new BkParallel(serverSafety);
var serverFront = new FtBasic(serverBack, port);
serverFront.start(Exit.NEVER);
return 0;
Expand Down
Loading