Skip to content

Commit 5391477

Browse files
committed
Removed jshellapi.schedulerThreadCount
1 parent e48c5a5 commit 5391477

3 files changed

Lines changed: 1 addition & 4 deletions

File tree

JShellAPI/src/main/java/org/togetherjava/jshellapi/Config.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public record Config(
1010
long maxAliveSessions,
1111
int dockerMaxRamMegaBytes,
1212
double dockerCPUsUsage,
13-
int schedulerThreadCount,
1413
long schedulerSessionKillScanRate) {
1514
public Config {
1615
if(regularSessionTimeoutSeconds <= 0) throw new RuntimeException("Invalid value " + regularSessionTimeoutSeconds);
@@ -19,7 +18,6 @@ public record Config(
1918
if(maxAliveSessions <= 0) throw new RuntimeException("Invalid value " + maxAliveSessions);
2019
if(dockerMaxRamMegaBytes <= 0) throw new RuntimeException("Invalid value " + dockerMaxRamMegaBytes);
2120
if(dockerCPUsUsage <= 0) throw new RuntimeException("Invalid value " + dockerCPUsUsage);
22-
if(schedulerThreadCount <= 0) throw new RuntimeException("Invalid value " + schedulerThreadCount);
2321
if(schedulerSessionKillScanRate <= 0) throw new RuntimeException("Invalid value " + schedulerSessionKillScanRate);
2422
}
2523
}

JShellAPI/src/main/java/org/togetherjava/jshellapi/service/JShellSessionService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class JShellSessionService {
1818
private ScheduledExecutorService scheduler;
1919
private final Map<String, JShellService> jshellSessions = new HashMap<>();
2020
private void initScheduler() {
21-
scheduler = Executors.newScheduledThreadPool(config.schedulerThreadCount());
21+
scheduler = Executors.newSingleThreadScheduledExecutor();
2222
scheduler.scheduleAtFixedRate(() -> {
2323
List<String> toDie = jshellSessions.keySet()
2424
.stream()

JShellAPI/src/main/resources/application.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ jshellapi.dockerMaxRamMegaBytes=100
1010
jshellapi.dockerCPUsUsage=0.5
1111

1212
# Internal config
13-
jshellapi.schedulerThreadCount=1
1413
jshellapi.schedulerSessionKillScanRate=60

0 commit comments

Comments
 (0)