[updater] IAE on poor man's single core agents

GitOrigin-RevId: 89d4e4bc076b19e4d388ecb95e3db1645f483fcf
This commit is contained in:
Roman Shevchenko
2020-06-19 20:29:23 +03:00
committed by intellij-monorepo-bot
parent 1182518e6b
commit f600f8cdf0
@@ -30,7 +30,7 @@ public class PatchFileCreator {
List<PatchAction> actions = patchInfo.getActions();
File olderDir = new File(spec.getOldFolder());
File newerDir = new File(spec.getNewFolder());
ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() - 1);
ExecutorService executor = Executors.newFixedThreadPool(Math.max(Runtime.getRuntime().availableProcessors() - 1, 1));
Map<PatchAction, Future<Path>> tasks = new ConcurrentHashMap<>();
for (int i = 0; i < actions.size(); i++) {