mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
Restore download queue async (#638)
The download queue was blocking the main thread, thus, slowing down the startup. In case the stored queue was huge, this could take multiple seconds
This commit is contained in:
@@ -71,6 +71,7 @@ object DownloadManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun restoreAndResumeDownloads() {
|
fun restoreAndResumeDownloads() {
|
||||||
|
scope.launch {
|
||||||
logger.debug { "restoreAndResumeDownloads: Restore download queue..." }
|
logger.debug { "restoreAndResumeDownloads: Restore download queue..." }
|
||||||
enqueue(EnqueueInput(loadDownloadQueue()))
|
enqueue(EnqueueInput(loadDownloadQueue()))
|
||||||
|
|
||||||
@@ -78,6 +79,7 @@ object DownloadManager {
|
|||||||
logger.info { "restoreAndResumeDownloads: Restored download queue, starting downloads..." }
|
logger.info { "restoreAndResumeDownloads: Restored download queue, starting downloads..." }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun addClient(ctx: WsContext) {
|
fun addClient(ctx: WsContext) {
|
||||||
clients[ctx.sessionId] = ctx
|
clients[ctx.sessionId] = ctx
|
||||||
|
|||||||
Reference in New Issue
Block a user