Skip to content

Commit

Permalink
Merge pull request #51 from tallence/cae-startup-fix
Browse files Browse the repository at this point in the history
if no site is configured yet, the maximum pool size is set to 1 inste…
  • Loading branch information
Jan-Hendrik Popp authored Aug 23, 2021
2 parents df6f6ab + 626ddc5 commit fb7cb73
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ private ControllingThreadPoolExecutorService newControllingThreadPoolExecutorSer
// possible. A SynchronousQueue wil try to pass the tasks to the pool, which can take as many threads as the number
// of all sites.
if (parallelSiteThreads == null) {
int numberOfSites = sitesService.getSites().size();
return new ControllingThreadPoolExecutorService(1, numberOfSites, 1L,
int maximumPoolSize = sitesService.getSites().isEmpty() ? 1 : sitesService.getSites().size();
return new ControllingThreadPoolExecutorService(1, maximumPoolSize, 1L,
TimeUnit.SECONDS, new SynchronousQueue<>(),
namedThreadFactory, pausableThreadPoolExecutorService);
} else {
Expand Down

0 comments on commit fb7cb73

Please sign in to comment.