Allow two fast fails

pull/202/head
M66B 3 years ago
parent d69675c9b9
commit 7245b03e22

@ -2073,7 +2073,7 @@ public class HtmlHelper {
if (TextDirectionHeuristics.FIRSTSTRONG_LTR.isRtl(quoted, start, end)) if (TextDirectionHeuristics.FIRSTSTRONG_LTR.isRtl(quoted, start, end))
return "border-right:3px solid #ccc; padding-left:3px;"; return "border-right:3px solid #ccc; padding-left:3px;";
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(ex); Log.e(new Throwable("getQuoteStyle", ex));
} }
return "border-left:3px solid #ccc; padding-left:3px;"; 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 = 90; // minutes
private static final int ACCOUNT_ERROR_AFTER_POLL = 4; // times 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_THRESHOLD = 75; // percent
private static final int FAST_FAIL_COUNT = 3;
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
@ -2107,7 +2108,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
fast_fails++; fast_fails++;
if (fast_fails == 1) if (fast_fails == 1)
first_fail = now; first_fail = now;
else { else if (fast_fails >= FAST_FAIL_COUNT) {
long avg_fail = (now - first_fail) / fast_fails; long avg_fail = (now - first_fail) / fast_fails;
if (avg_fail < fail_threshold) { if (avg_fail < fail_threshold) {
long missing = (fail_threshold - avg_fail) * fast_fails; long missing = (fail_threshold - avg_fail) * fast_fails;

Loading…
Cancel
Save