1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-22 15:55:57 +00:00

Refactoring

This commit is contained in:
M66B 2024-11-30 07:41:47 +01:00
parent af221f9117
commit d76db13b54

View file

@ -160,6 +160,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
private static final int FETCH_YIELD_DURATION = 50; // milliseconds private static final int FETCH_YIELD_DURATION = 50; // milliseconds
private static final long WATCHDOG_INTERVAL = 60 * 60 * 1000L; // milliseconds private static final long WATCHDOG_INTERVAL = 60 * 60 * 1000L; // milliseconds
private static final long MAX_QUOTA = 1000 * 1000 * 1000L; // KB private static final long MAX_QUOTA = 1000 * 1000 * 1000L; // KB
private static final int YAHOO_RESTART_INTERVAL = 120; // seconds
private static final String ACTION_NEW_MESSAGE_COUNT = BuildConfig.APPLICATION_ID + ".NEW_MESSAGE_COUNT"; private static final String ACTION_NEW_MESSAGE_COUNT = BuildConfig.APPLICATION_ID + ".NEW_MESSAGE_COUNT";
@ -1671,8 +1672,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (account.keep_alive_noop) { if (account.keep_alive_noop) {
int timeout = prefs.getInt("timeout", EmailService.DEFAULT_CONNECT_TIMEOUT); int timeout = prefs.getInt("timeout", EmailService.DEFAULT_CONNECT_TIMEOUT);
if (account.isYahoo() && timeout < 60) { if (account.isYahoo() && timeout < YAHOO_RESTART_INTERVAL) {
int factor = 60 / timeout; int factor = YAHOO_RESTART_INTERVAL / timeout;
iservice.setRestartIdleInterval(timeout * factor); iservice.setRestartIdleInterval(timeout * factor);
} else } else
iservice.setRestartIdleInterval(timeout * 2 * 6); // 20 x 2 x 6 = 4 min iservice.setRestartIdleInterval(timeout * 2 * 6); // 20 x 2 x 6 = 4 min