1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-24 08:48:51 -05:00

* if anything goes wrong make sure to unwind as a partial episode set possibly missing important data can lead to bad matches

This commit is contained in:
Reinhard Pointner 2012-12-10 16:34:21 +00:00
parent a05c98dce7
commit 58b23a36ad

View File

@ -37,7 +37,6 @@ import java.util.SortedSet;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.TreeSet; import java.util.TreeSet;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.Future; import java.util.concurrent.Future;
@ -285,18 +284,15 @@ public class CmdlineOperations implements CmdlineInterface {
Set<Episode> episodes = new LinkedHashSet<Episode>(); Set<Episode> episodes = new LinkedHashSet<Episode>();
for (Future<List<Episode>> future : executor.invokeAll(tasks)) { for (Future<List<Episode>> future : executor.invokeAll(tasks)) {
try { // if anything goes wrong make sure to unwind as a partial episode set possibly missing important data can lead to bad matches
episodes.addAll(future.get()); episodes.addAll(future.get());
} catch (ExecutionException e) {
CLILogger.finest(e.getCause().getMessage());
}
} }
// all background workers have finished // all background workers have finished
return episodes; return episodes;
} finally { } finally {
// destroy background threads // destroy background threads
executor.shutdown(); executor.shutdownNow();
} }
} }