forked from Archives/Athou_commafeed
disable incrementally by one hour every time the feed fails to download (#44)
This commit is contained in:
@@ -117,9 +117,9 @@ public class FeedUtils {
|
|||||||
int retriesBeforeDisable = 3;
|
int retriesBeforeDisable = 3;
|
||||||
|
|
||||||
if (errorCount >= retriesBeforeDisable) {
|
if (errorCount >= retriesBeforeDisable) {
|
||||||
int disabledMinutes = 10 * (errorCount - retriesBeforeDisable + 1);
|
int disabledHours = errorCount - retriesBeforeDisable + 1;
|
||||||
disabledMinutes = Math.min(60 * 12, disabledMinutes);
|
disabledHours = Math.min(24, disabledHours);
|
||||||
return DateUtils.addMinutes(now, disabledMinutes);
|
return DateUtils.addHours(now, disabledHours);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user