File tree Expand file tree Collapse file tree
java/org/togetherjava/jshellapi Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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 ()
Original file line number Diff line number Diff line change @@ -10,5 +10,4 @@ jshellapi.dockerMaxRamMegaBytes=100
1010jshellapi.dockerCPUsUsage =0.5
1111
1212# Internal config
13- jshellapi.schedulerThreadCount =1
1413jshellapi.schedulerSessionKillScanRate =60
You can’t perform that action at this time.
0 commit comments