[jps-cache] Clear download folder and fix extract cancellation

GitOrigin-RevId: ca4c1d9e6cfd331faa4ff632c87b011286020e37
This commit is contained in:
Mikhail Mazurkevich
2019-12-04 08:04:11 +00:00
committed by intellij-monorepo-bot
parent 6f4b9e4b92
commit 053ff7f9b7
3 changed files with 4 additions and 5 deletions
@@ -143,8 +143,9 @@ public class TemporaryCacheServerClient implements JpsServerClient {
catch (ProcessCanceledException | IOException e) {
//noinspection InstanceofCatchParameter
if (e instanceof IOException) LOG.warn("Failed to download JPS compilation outputs", e);
if (targetDir.exists()) FileUtil.delete(targetDir);
downloadedFiles.forEach(zipFile -> FileUtil.delete(zipFile));
return Collections.emptyList();
return null;
}
}
@@ -89,7 +89,7 @@ class JpsCompilationOutputLoader implements JpsOutputLoader<List<OutputLoadResul
extractIndicatorManager.setText(this, "Extracting downloaded results...");
List<Future<?>> futureList = ContainerUtil.map(outputLoadResults, loadResult ->
myExecutorService.submit(new UnzipOutputTask(result, loadResult, extractIndicatorManager)));
for (Future future : futureList) {
for (Future<?> future : futureList) {
future.get();
}
extractIndicatorManager.finished(this);
@@ -65,9 +65,7 @@ public class JpsOutputLoaderManager {
// Configure build manager
BuildManager buildManager = BuildManager.getInstance();
if (!buildManager.isGeneratePortableCachesEnabled()) buildManager.setGeneratePortableCachesEnabled(true);
myExecutorService = AppExecutorUtil.createBoundedApplicationPoolExecutor("JpsCacheLoader Pool",
INSTANCE,
getThreadPoolSize());
myExecutorService = AppExecutorUtil.createBoundedApplicationPoolExecutor("JpsCacheLoader Pool", INSTANCE, getThreadPoolSize());
}
public void load(boolean isForceUpdate) {