forked from Qortal/qortal
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...
This commit is contained in:
parent
bd87e6cc1a
commit
70131914b2
@ -149,8 +149,8 @@ public class ApiRequest {
|
|||||||
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
||||||
|
|
||||||
con.setRequestMethod("GET");
|
con.setRequestMethod("GET");
|
||||||
con.setConnectTimeout(5000);
|
con.setConnectTimeout(30000);
|
||||||
con.setReadTimeout(3000);
|
con.setReadTimeout(10000);
|
||||||
ApiRequest.setConnectionSSL(con, ipAddress);
|
ApiRequest.setConnectionSSL(con, ipAddress);
|
||||||
|
|
||||||
int status = con.getResponseCode();
|
int status = con.getResponseCode();
|
||||||
|
@ -41,7 +41,7 @@ public class AutoUpdate extends Thread {
|
|||||||
public static final String NEW_JAR_FILENAME = "new-" + JAR_FILENAME;
|
public static final String NEW_JAR_FILENAME = "new-" + JAR_FILENAME;
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger(AutoUpdate.class);
|
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 DEV_GROUP_ID = 1;
|
||||||
private static final int UPDATE_SERVICE = 1;
|
private static final int UPDATE_SERVICE = 1;
|
||||||
@ -210,7 +210,7 @@ public class AutoUpdate extends Thread {
|
|||||||
return false; // failed - try another repo
|
return false; // failed - try another repo
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} 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
|
return false; // failed - try another repo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user