kill other workers if download is finished

pull/9/head test-signed-tag
Zlatin Balevsky 2019-07-06 22:21:13 +01:00
parent 72ff47ffe5
commit d8e44f5f39
1 changed files with 4 additions and 0 deletions

View File

@ -314,6 +314,10 @@ public class Downloader {
piecesFileClosed = true
piecesFile.delete()
}
activeWorkers.values().each {
if (it.destination != destination)
it.cancel()
}
try {
Files.move(incompleteFile.toPath(), file.toPath(), StandardCopyOption.ATOMIC_MOVE)
} catch (AtomicMoveNotSupportedException e) {