Skip to content

Commit

Permalink
chore(automatedanalysis): use independent singlethreadexecutor if run…
Browse files Browse the repository at this point in the history
…ning on single CPU (#297)
  • Loading branch information
andrewazores authored Feb 26, 2024
1 parent 7031727 commit dcce41f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/io/cryostat/Producers.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ public static ScheduledExecutorService produceScheduledExecutorService() {
@RequestScoped
@DefaultBean
public static InterruptibleReportGenerator produceInterruptibleReportGenerator() {
return new InterruptibleReportGenerator(ForkJoinPool.commonPool());
boolean singleThread = Runtime.getRuntime().availableProcessors() < 2;
return new InterruptibleReportGenerator(
singleThread ? Executors.newSingleThreadExecutor() : ForkJoinPool.commonPool());
}

@Produces
Expand Down

0 comments on commit dcce41f

Please sign in to comment.