diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/kobo/KepubConverter.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/kobo/KepubConverter.kt index 5a4722ad2..4f43f3749 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/kobo/KepubConverter.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/kobo/KepubConverter.kt @@ -137,7 +137,14 @@ class KepubConverter( destinationPath.toString(), ) logger.debug { "Starting conversion with: ${command.joinToString(" ")}" } - val process = Runtime.getRuntime().exec(command) + val process = + try { + Runtime.getRuntime().exec(command) + } catch (e: Exception) { + logger.error(e) { "Failed to create process" } + return null + } + if (!process.waitFor(10, TimeUnit.SECONDS)) { logger.error { "Kepub conversion timeout. Command: ${command.joinToString(" ")}" } return null