Fixed #39
This commit is contained in:
@@ -176,7 +176,7 @@ public class TaskList extends Thread {
|
||||
while (!in.isEmpty())
|
||||
synchronized (in) {
|
||||
Invoker it = in.iterator().next();
|
||||
if (!it.task.abort())
|
||||
if (!it.task.abort() && futures.get(it) != null)
|
||||
futures.get(it).cancel(true);
|
||||
in.remove(it);
|
||||
}
|
||||
|
||||
@@ -118,8 +118,7 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
|
||||
this.url = IOUtils.parseURL(p.getResult());
|
||||
|
||||
for (int repeat = 0; repeat < 6; repeat++) {
|
||||
if (repeat > 0) {
|
||||
HMCLog.warn("Failed to download, repeat: " + repeat);
|
||||
if (repeat > 0)
|
||||
if (failedCallbackReturnsNewURL != null) {
|
||||
URL tmp = IOUtils.parseURL(failedCallbackReturnsNewURL.apply(repeat));
|
||||
if (tmp != null) {
|
||||
@@ -127,7 +126,7 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
|
||||
HMCLog.warn("Switch to: " + url);
|
||||
}
|
||||
}
|
||||
}
|
||||
HMCLog.log("Downloading: " + url + ", to: " + filePath);
|
||||
if (!shouldContinue)
|
||||
break;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user