From e60acb86ff4bc156f5b907e9688156cf2b2f9480 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Wed, 22 Dec 2021 10:13:59 +0800 Subject: [PATCH] fix(api): library scan is always highest priority --- .../org/gotson/komga/interfaces/api/rest/LibraryController.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/LibraryController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/LibraryController.kt index a3ec817e5..a75b7e9bc 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/LibraryController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/LibraryController.kt @@ -1,5 +1,6 @@ package org.gotson.komga.interfaces.api.rest +import org.gotson.komga.application.tasks.HIGHEST_PRIORITY import org.gotson.komga.application.tasks.HIGH_PRIORITY import org.gotson.komga.application.tasks.TaskReceiver import org.gotson.komga.domain.model.DirectoryNotFoundException @@ -161,7 +162,7 @@ class LibraryController( @ResponseStatus(HttpStatus.ACCEPTED) fun scan(@PathVariable libraryId: String) { libraryRepository.findByIdOrNull(libraryId)?.let { library -> - taskReceiver.scanLibrary(library.id) + taskReceiver.scanLibrary(library.id, HIGHEST_PRIORITY) } ?: throw ResponseStatusException(HttpStatus.NOT_FOUND) }