mirror of https://github.com/M66B/FairEmail.git
Optimize keep alive < 12 minutes
This commit is contained in:
parent
faa3e11b3b
commit
8f858a3f35
|
@ -105,6 +105,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||||
private static final long QUIT_DELAY = 5 * 1000L; // milliseconds
|
private static final long QUIT_DELAY = 5 * 1000L; // milliseconds
|
||||||
private static final long STILL_THERE_THRESHOLD = 3 * 60 * 1000L; // milliseconds
|
private static final long STILL_THERE_THRESHOLD = 3 * 60 * 1000L; // milliseconds
|
||||||
static final int DEFAULT_POLL_INTERVAL = 0; // minutes
|
static final int DEFAULT_POLL_INTERVAL = 0; // minutes
|
||||||
|
private static final int OPTIMIZE_KEEP_ALIVE_INTERVAL = 12; // minutes
|
||||||
private static final int OPTIMIZE_POLL_INTERVAL = 15; // minutes
|
private static final int OPTIMIZE_POLL_INTERVAL = 15; // minutes
|
||||||
private static final int CONNECT_BACKOFF_START = 8; // seconds
|
private static final int CONNECT_BACKOFF_START = 8; // seconds
|
||||||
private static final int CONNECT_BACKOFF_MAX = 32; // seconds (totally ~1 minutes)
|
private static final int CONNECT_BACKOFF_MAX = 32; // seconds (totally ~1 minutes)
|
||||||
|
@ -952,7 +953,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||||
|
|
||||||
final boolean capIdle = iservice.hasCapability("IDLE");
|
final boolean capIdle = iservice.hasCapability("IDLE");
|
||||||
Log.i(account.name + " idle=" + capIdle);
|
Log.i(account.name + " idle=" + capIdle);
|
||||||
if (!capIdle || account.poll_interval < OPTIMIZE_POLL_INTERVAL)
|
if (!capIdle || account.poll_interval < OPTIMIZE_KEEP_ALIVE_INTERVAL)
|
||||||
optimizeAccount(ServiceSynchronize.this, account, "IDLE");
|
optimizeAccount(ServiceSynchronize.this, account, "IDLE");
|
||||||
|
|
||||||
db.account().setAccountState(account.id, "connected");
|
db.account().setAccountState(account.id, "connected");
|
||||||
|
|
Loading…
Reference in New Issue