mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-24 22:48:34 +00:00
Bugfixed ThreadPool awaitTermination call in ManeuverAndWindImporter
This commit is contained in:
+2
-2
@@ -141,8 +141,8 @@ public class ManeuverAndWindImporter {
|
||||
+ Math.round(100.0 * i / numberOfRegattas) + "%): \"" + regattaName + "\"");
|
||||
importRegatta(regattaName, importStatistics);
|
||||
}
|
||||
boolean success = executorService.awaitTermination(24, TimeUnit.HOURS);
|
||||
executorService.shutdown();
|
||||
boolean success = executorService.awaitTermination(2, TimeUnit.HOURS);
|
||||
if (success) {
|
||||
LoggingUtil.logInfo("Import finished");
|
||||
synchronized (importStatistics) {
|
||||
@@ -150,7 +150,7 @@ public class ManeuverAndWindImporter {
|
||||
logImportStatistics(importStatistics);
|
||||
}
|
||||
} else {
|
||||
LoggingUtil.logInfo("Process was terminated");
|
||||
new InterruptedException("Thread-pool was terminated after two hours waiting time");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -109,7 +109,10 @@ public class SimpleModelsTraining {
|
||||
|
||||
private static void awaitThreadPoolCompletion() throws InterruptedException {
|
||||
executorService.shutdown();
|
||||
executorService.awaitTermination(24, TimeUnit.HOURS);
|
||||
boolean success = executorService.awaitTermination(2, TimeUnit.HOURS);
|
||||
if (!success) {
|
||||
new InterruptedException("Thread-pool was terminated after two hours waiting time");
|
||||
}
|
||||
Thread.sleep(1000L);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user