mirror of https://github.com/M66B/FairEmail.git
Allow two fast fails
This commit is contained in:
parent
d69675c9b9
commit
7245b03e22
|
@ -2073,7 +2073,7 @@ public class HtmlHelper {
|
|||
if (TextDirectionHeuristics.FIRSTSTRONG_LTR.isRtl(quoted, start, end))
|
||||
return "border-right:3px solid #ccc; padding-left:3px;";
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
Log.e(new Throwable("getQuoteStyle", ex));
|
||||
}
|
||||
|
||||
return "border-left:3px solid #ccc; padding-left:3px;";
|
||||
|
|
|
@ -128,6 +128,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
private static final int ACCOUNT_ERROR_AFTER = 90; // minutes
|
||||
private static final int ACCOUNT_ERROR_AFTER_POLL = 4; // times
|
||||
private static final int FAST_FAIL_THRESHOLD = 75; // percent
|
||||
private static final int FAST_FAIL_COUNT = 3;
|
||||
private static final int FETCH_YIELD_DURATION = 50; // milliseconds
|
||||
private static final long WATCHDOG_INTERVAL = 60 * 60 * 1000L; // milliseconds
|
||||
|
||||
|
@ -2107,7 +2108,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
fast_fails++;
|
||||
if (fast_fails == 1)
|
||||
first_fail = now;
|
||||
else {
|
||||
else if (fast_fails >= FAST_FAIL_COUNT) {
|
||||
long avg_fail = (now - first_fail) / fast_fails;
|
||||
if (avg_fail < fail_threshold) {
|
||||
long missing = (fail_threshold - avg_fail) * fast_fails;
|
||||
|
|
Loading…
Reference in New Issue