assume all persisted sources were successful

pull/53/head
Zlatin Balevsky 2020-10-12 14:54:55 +01:00
parent 6f6d6f5065
commit 5bddfc10e9
No known key found for this signature in database
GPG Key ID: A72832072D525E41
2 changed files with 3 additions and 1 deletions

View File

@ -172,6 +172,8 @@ public class DownloadManager {
if (json.paused != null)
downloader.paused = json.paused
downloader.successfulDestinations.addAll(destinations) // if it was persisted, it was successful
try {
downloader.readPieces()
if (!downloader.paused)

View File

@ -59,7 +59,7 @@ public class Downloader {
private final File incompleteFile
final int pieceSizePow2
private final Map<Destination, DownloadWorker> activeWorkers = new ConcurrentHashMap<>()
private final Set<Destination> successfulDestinations = new ConcurrentHashSet<>()
final Set<Destination> successfulDestinations = new ConcurrentHashSet<>()
/** LOCKING: itself */
private final Map<Destination, Integer> failingDestinations = new HashMap<>()
private final int maxFailures