write pieces every time a downloader finishes

pull/9/head
Zlatin Balevsky 2019-07-06 00:52:49 +01:00
parent 3cc0574d11
commit a9dc636bce
1 changed files with 1 additions and 0 deletions

View File

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