Speed up mass resume/retry of downloads. GitHub issue #89

auto-update
Zlatin Balevsky 2021-10-15 02:11:39 +01:00
parent 6b105f96bb
commit bc4f61bcdb
No known key found for this signature in database
GPG Key ID: A72832072D525E41
2 changed files with 18 additions and 16 deletions

View File

@ -220,8 +220,9 @@ class NetworkDownloader extends Downloader {
}
protected void doResume() {
executorService.submit {
readPieces()
destinations.stream().filter({!isHopeless(it)}).forEach { destination ->
destinations.stream().filter({ !isHopeless(it) }).forEach { destination ->
log.fine("resuming source ${destination.toBase32()}")
def worker = activeWorkers.get(destination)
if (worker != null) {
@ -236,6 +237,7 @@ class NetworkDownloader extends Downloader {
executorService.submit(worker)
}
}
} as Runnable
}
void addSource(Destination d) {

View File

@ -340,8 +340,8 @@ class MainFrameModel {
if (state == Downloader.DownloadState.FAILED ||
state == Downloader.DownloadState.DOWNLOADING)
it.downloader.resume()
updateTablePreservingSelection("downloads-table")
}
updateTablePreservingSelection("downloads-table")
}
}
@ -654,7 +654,7 @@ class MainFrameModel {
results.values().each { MVCGroup group ->
if (group.alive) {
group.view.pane.getClientProperty("results-table")?.model.fireTableDataChanged()
group.view.refreshResults()
}
}
}