Fixed that images download doesn't start again after too many errors;

This commit is contained in:
Oleg Agafonov 2019-05-29 07:53:40 +04:00
parent a9329c130d
commit 84e0764bd4

View file

@ -129,6 +129,10 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
public void incErrorCount() {
this.errorCount = this.errorCount + 1;
if (this.errorCount == MAX_ERRORS_COUNT_BEFORE_CANCEL + 1) {
logger.warn("Too many errors (> " + MAX_ERRORS_COUNT_BEFORE_CANCEL + ") in images download");
}
}
private void resetErrorCount() {
@ -571,6 +575,7 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
@Override
public void run() {
this.cardIndex = 0;
this.resetErrorCount();
File base = new File(getImagesDir());
if (!base.exists()) {