From bd87e6cc1a3c25cc93812bd3ed8d18df84957a24 Mon Sep 17 00:00:00 2001 From: catbref Date: Thu, 26 Mar 2020 12:38:08 +0000 Subject: [PATCH] Increase retry interval and count in ApplyUpdate. Used when checking that node has shutdown and when replacing old JAR with new update. ApplyUpdate previously waited 5 seconds between checks/retries, for up to 5 times: 25 seconds. Now waits 10 seconds, for up to 12 times: 120 seconds. Hopefully this will give slower nodes enough time to shut down and prevent errors like these on Windows installs: 2020-03-24 12:05:50 INFO ApplyUpdate:114 - Unable to replace JAR: qortal.jar: The process cannot access the file because it is being used by another process. --- src/main/java/org/qortal/ApplyUpdate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/qortal/ApplyUpdate.java b/src/main/java/org/qortal/ApplyUpdate.java index 74c57a37..0a432c4e 100644 --- a/src/main/java/org/qortal/ApplyUpdate.java +++ b/src/main/java/org/qortal/ApplyUpdate.java @@ -36,8 +36,8 @@ public class ApplyUpdate { private static final String NEW_JAR_FILENAME = AutoUpdate.NEW_JAR_FILENAME; private static final String WINDOWS_EXE_LAUNCHER = "qortal.exe"; - private static final long CHECK_INTERVAL = 5 * 1000L; // ms - private static final int MAX_ATTEMPTS = 5; + private static final long CHECK_INTERVAL = 10 * 1000L; // ms + private static final int MAX_ATTEMPTS = 12; public static void main(String[] args) { Security.insertProviderAt(new BouncyCastleProvider(), 0);