From c9c4e84ee4c0fa569dfe108976ba8453bef9fb73 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 17 Feb 2019 18:30:16 +0700 Subject: [PATCH] Best effort to avoid cache corruption if process is killed or crashes --- source/net/filebot/License.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/net/filebot/License.java b/source/net/filebot/License.java index 06cb1e6a..0fc29abd 100644 --- a/source/net/filebot/License.java +++ b/source/net/filebot/License.java @@ -149,6 +149,9 @@ public class License { return WebRequest.post(url, psm.getBytes(UTF_8), "application/octet-stream", getRequestParameters()); }).expire(Cache.ONE_MONTH).get(); + // flush all cache from memory to the disk store + cache.flush(); + if (getInteger(json, "status") != 200) { throw new IllegalStateException(getString(json, "message")); }