refactor: refine logs

This commit is contained in:
Gauthier Roebroeck 2020-04-27 11:10:34 +08:00
parent 6a8e1f94ec
commit d275506eac
2 changed files with 3 additions and 2 deletions

View file

@ -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()

View file

@ -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()
}
}