From d275506eacaa34f016c304a0e51de7eb8440d263 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Mon, 27 Apr 2020 11:10:34 +0800 Subject: [PATCH] refactor: refine logs --- .../kotlin/org/gotson/komga/domain/service/LibraryScanner.kt | 4 ++-- .../komga/interfaces/scheduler/PeriodicScannerController.kt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/komga/src/main/kotlin/org/gotson/komga/domain/service/LibraryScanner.kt b/komga/src/main/kotlin/org/gotson/komga/domain/service/LibraryScanner.kt index f1691d1dd..9c0903af0 100644 --- a/komga/src/main/kotlin/org/gotson/komga/domain/service/LibraryScanner.kt +++ b/komga/src/main/kotlin/org/gotson/komga/domain/service/LibraryScanner.kt @@ -46,7 +46,7 @@ class LibraryScanner( } else { // if series already exists, update it if (newSeries.fileLastModified.truncatedTo(ChronoUnit.MILLIS) != existingSeries.fileLastModified.truncatedTo(ChronoUnit.MILLIS)) { - logger.info { "Series changed on disk, updating: $newSeries" } + logger.info { "Series changed on disk, updating: $existingSeries" } existingSeries.fileLastModified = newSeries.fileLastModified // update list of books with existing entities if they exist @@ -54,7 +54,7 @@ class LibraryScanner( val existingBook = bookRepository.findByUrl(newBook.url) ?: newBook if (newBook.fileLastModified.truncatedTo(ChronoUnit.MILLIS) != existingBook.fileLastModified.truncatedTo(ChronoUnit.MILLIS)) { - logger.info { "Book changed on disk, update and reset media status: $newBook" } + logger.info { "Book changed on disk, update and reset media status: $existingBook" } existingBook.fileLastModified = newBook.fileLastModified existingBook.fileSize = newBook.fileSize existingBook.media.reset() diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/scheduler/PeriodicScannerController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/scheduler/PeriodicScannerController.kt index 73afa2a40..55f4b061c 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/scheduler/PeriodicScannerController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/scheduler/PeriodicScannerController.kt @@ -19,6 +19,7 @@ class PeriodicScannerController( @EventListener(classes = [ApplicationReadyEvent::class], condition = "@komgaProperties.librariesScanStartup") @Scheduled(cron = "#{@komgaProperties.librariesScanCron ?: '-'}") fun scanAllLibraries() { + logger.info { "Periodic libraries scan starting" } taskReceiver.scanLibraries() } }