Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 389a2a6

Browse files
committedDec 25, 2015
fix:由于修改架构autoRetryTimes,导致暂停以后无法重试的问题
1 parent 4a76de6 commit 389a2a6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎library/src/main/java/com/liulishuo/filedownloader/services/FileDownloadRunnable.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void run() {
146146

147147
if (model.isCanceled()) {
148148
FileDownloadLog.d(this, "already canceled %d %d", model.getId(), model.getStatus());
149-
return;
149+
break;
150150
}
151151

152152
FileDownloadLog.d(FileDownloadRunnable.class, "start download %s %s", getId(), model.getUrl());
@@ -250,11 +250,12 @@ public void run() {
250250
onError(ex);
251251
break;
252252
}
253+
} finally {
254+
isRunning = false;
253255
}
254256

255257
} while (true);
256258

257-
isRunning = false;
258259

259260
}
260261

@@ -367,6 +368,7 @@ private void onComplete(final int total) {
367368
}
368369

369370
private void onPause() {
371+
this.isRunning = false;
370372
FileDownloadLog.d(this, "On paused %d %d %d", downloadTransfer.getDownloadId(), downloadTransfer.getSoFarBytes(), downloadTransfer.getTotalBytes());
371373
downloadTransfer.setStatus(FileDownloadStatus.paused);
372374

0 commit comments

Comments
 (0)
Failed to load comments.