Browse Source

Auto-updates: increase checking interval & TCP timeouts

Bumped TCP timeouts for fetching auto-update from 5s (connect) and
3s (read) to 30s (connect) and 10s (read) to allow for nodes with
slower internet connections.

Increased interval between checking for auto-updates from 5 minutes
to 20 minutes to reduce load on update sources and also to reduce
the number of nodes that restart at any one time.

Obviously this new checking interval will only apply after the NEXT
auto-update...
split-DB
catbref 5 years ago
parent
commit
70131914b2
  1. 4
      src/main/java/org/qortal/api/ApiRequest.java
  2. 4
      src/main/java/org/qortal/controller/AutoUpdate.java

4
src/main/java/org/qortal/api/ApiRequest.java

@ -149,8 +149,8 @@ public class ApiRequest {
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setConnectTimeout(5000);
con.setReadTimeout(3000);
con.setConnectTimeout(30000);
con.setReadTimeout(10000);
ApiRequest.setConnectionSSL(con, ipAddress);
int status = con.getResponseCode();

4
src/main/java/org/qortal/controller/AutoUpdate.java

@ -41,7 +41,7 @@ public class AutoUpdate extends Thread {
public static final String NEW_JAR_FILENAME = "new-" + JAR_FILENAME;
private static final Logger LOGGER = LogManager.getLogger(AutoUpdate.class);
private static final long CHECK_INTERVAL = 5 * 60 * 1000L; // ms
private static final long CHECK_INTERVAL = 20 * 60 * 1000L; // ms
private static final int DEV_GROUP_ID = 1;
private static final int UPDATE_SERVICE = 1;
@ -210,7 +210,7 @@ public class AutoUpdate extends Thread {
return false; // failed - try another repo
}
} catch (IOException e) {
LOGGER.warn(String.format("Failed to fetch update from %s", repoUri));
LOGGER.warn(String.format("Failed to fetch update from %s: %s", repoUri, e.getMessage()));
return false; // failed - try another repo
}

Loading…
Cancel
Save