write pieces every time a downloader finishes

This commit is contained in:
Zlatin Balevsky
2019-07-06 00:52:49 +01:00
parent 3cc0574d11
commit a9dc636bce

View File

@@ -307,6 +307,7 @@ public class Downloader {
} catch (Exception bad) {
log.log(Level.WARNING,"Exception while downloading",DataUtil.findRoot(bad))
} finally {
writePieces()
currentState = WorkerState.FINISHED
if (pieces.isComplete() && eventFired.compareAndSet(false, true)) {
synchronized(piecesFile) {