From 84e0764bd4db17b38180fc89243404d9ccac0b89 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Wed, 29 May 2019 07:53:40 +0400 Subject: [PATCH] Fixed that images download doesn't start again after too many errors; --- .../mage/plugins/card/images/DownloadPicturesService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPicturesService.java b/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPicturesService.java index 13dd0a9883c..c855764fd6b 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPicturesService.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPicturesService.java @@ -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()) {