Changed still there poll interval to 15 minutes

This commit is contained in:
M66B 2020-02-22 18:13:44 +01:00
parent 341701ff3f
commit 2ec44adc4f
1 changed files with 4 additions and 3 deletions

View File

@ -105,7 +105,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
private static final long YIELD_DURATION = 200L; // milliseconds
private static final long QUIT_DELAY = 5 * 1000L; // milliseconds
private static final long STILL_THERE_DELAY = 3 * 60 * 1000L; // milliseconds
private static final long STILL_THERE_THRESHOLD = 3 * 60 * 1000L; // milliseconds
private static final int STILL_THERE_POLL_INTERVAL = 15; // minutes
private static final int CONNECT_BACKOFF_START = 8; // seconds
private static final int CONNECT_BACKOFF_MAX = 64; // seconds (totally 2 minutes)
private static final int CONNECT_BACKOFF_AlARM_START = 15; // minutes
@ -825,7 +826,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if ("Still here".equals(message) && !account.ondemand) {
long now = new Date().getTime();
if (now - start > STILL_THERE_DELAY)
if (now - start > STILL_THERE_THRESHOLD)
return;
boolean auto_optimize = prefs.getBoolean("auto_optimize", true);
@ -834,7 +835,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
int pollInterval = prefs.getInt("poll_interval", 0);
if (pollInterval == 0) {
prefs.edit().putInt("poll_interval", 30).apply();
prefs.edit().putInt("poll_interval", STILL_THERE_POLL_INTERVAL).apply();
try {
db.beginTransaction();
for (EntityAccount a : db.account().getAccounts())