From 24cf1819b02dd2625d7a6327a17ef2081cf52e64 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Tue, 20 Apr 2021 10:04:48 +0800 Subject: [PATCH] fix(importer): hardlink fails inside docker docker does not support hardlinks between different mounts fallback to copy in that case --- .../kotlin/org/gotson/komga/domain/service/BookImporter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/komga/src/main/kotlin/org/gotson/komga/domain/service/BookImporter.kt b/komga/src/main/kotlin/org/gotson/komga/domain/service/BookImporter.kt index b2b0660a8..420302d2a 100644 --- a/komga/src/main/kotlin/org/gotson/komga/domain/service/BookImporter.kt +++ b/komga/src/main/kotlin/org/gotson/komga/domain/service/BookImporter.kt @@ -85,8 +85,8 @@ class BookImporter( CopyMode.HARDLINK -> try { logger.info { "Hardlink file $sourceFile to $destFile" } Files.createLink(destFile, sourceFile) - } catch (e: UnsupportedOperationException) { - logger.warn { "Filesystem does not support hardlinks, copying instead" } + } catch (e: Exception) { + logger.warn(e) { "Filesystem does not support hardlinks, copying instead" } sourceFile.copyTo(destFile) } }