From a63556e3f4f77e2914088d1edaadf47b2eba6318 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 19 Feb 2019 01:13:53 +0700 Subject: [PATCH] flush all memory caches to disk (before starting any long running file system operations that might be cancelled by the user) --- source/net/filebot/cli/CmdlineOperations.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/source/net/filebot/cli/CmdlineOperations.java b/source/net/filebot/cli/CmdlineOperations.java index 7c439b6c..e8c86230 100644 --- a/source/net/filebot/cli/CmdlineOperations.java +++ b/source/net/filebot/cli/CmdlineOperations.java @@ -740,9 +740,6 @@ public class CmdlineOperations implements CmdlineInterface { } catch (Exception e) { log.warning("Lookup by hash failed: " + e.getMessage()); } - - // flush all memory caches to disk (before starting any long running file system operations that might be cancelled by the user) - CacheManager.getInstance().flushAll(); } for (SubtitleProvider service : getSubtitleProviders(language.getLocale())) { @@ -759,9 +756,6 @@ public class CmdlineOperations implements CmdlineInterface { } catch (Exception e) { log.warning(format("Search by name failed: %s", e.getMessage())); } - - // flush all memory caches to disk (before starting any long running file system operations that might be cancelled by the user) - CacheManager.getInstance().flushAll(); } // no subtitles for remaining video files @@ -830,6 +824,9 @@ public class CmdlineOperations implements CmdlineInterface { } private Map downloadSubtitleBatch(Datasource service, Map> subtitles, SubtitleFormat outputFormat, Charset outputEncoding, SubtitleNaming naming) { + // flush all memory caches to disk (before starting any long running file system operations that might be cancelled by the user) + CacheManager.getInstance().flushAll(); + Map downloads = new LinkedHashMap(); // fetch subtitle