1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-21 23:32:51 +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 long WATCHDOG_INTERVAL = 60 * 60 * 1000L; // milliseconds
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";
@ -1671,8 +1672,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (account.keep_alive_noop) {
int timeout = prefs.getInt("timeout", EmailService.DEFAULT_CONNECT_TIMEOUT);
if (account.isYahoo() && timeout < 60) {
int factor = 60 / timeout;
if (account.isYahoo() && timeout < YAHOO_RESTART_INTERVAL) {
int factor = YAHOO_RESTART_INTERVAL / timeout;
iservice.setRestartIdleInterval(timeout * factor);
} else
iservice.setRestartIdleInterval(timeout * 2 * 6); // 20 x 2 x 6 = 4 min