Readaround logic tweaks

This commit is contained in:
tarsin committed 2023-02-14 15:35:04 +08:00
1 parent 3941f59bbc
commit d7b08a0181
3 files changed
+1 -12

No files matched your search

@@ -63,14 +63,6 @@ class SpiderQueenWorker(private val queen: SpiderQueen) : CoroutineScope {
fun updateRAList(list: List<Int>) {
if (isDownloadMode) return
synchronized(mFetcherJobMap) {
sequence {
mFetcherJobMap.forEach { (i, job) ->
if (i !in list) {
job.cancel()
}
if (!job.isActive) yield(i)
}
}.toSet().forEach { mFetcherJobMap.remove(it) }
list.forEach {
if (mFetcherJobMap[it]?.isActive != true)
doLaunchDownloadJob(it, false)