mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Fixed that images download doesn't start again after too many errors;
This commit is contained in:
parent
a9329c130d
commit
84e0764bd4
1 changed files with 5 additions and 0 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue