From 9567df1cae9373919cd33700754a1dceac88a046 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Tue, 15 Jul 2025 13:24:14 +0800 Subject: [PATCH] refactor(komga): remove artemis cleanup --- .../resources/application-benchmark.yml | 3 -- .../infrastructure/jms/ArtemisCleanup.kt | 31 ------------------- .../main/resources/application-localdb.yml | 4 --- komga/src/main/resources/application.yml | 6 ---- 4 files changed, 44 deletions(-) delete mode 100644 komga/src/main/kotlin/org/gotson/komga/infrastructure/jms/ArtemisCleanup.kt diff --git a/komga/src/benchmark/resources/application-benchmark.yml b/komga/src/benchmark/resources/application-benchmark.yml index eff0e9890..4ae9ee875 100644 --- a/komga/src/benchmark/resources/application-benchmark.yml +++ b/komga/src/benchmark/resources/application-benchmark.yml @@ -21,9 +21,6 @@ komga: spring: flyway: enabled: true - artemis: - embedded: - data-directory: \${komga.config-dir}/artemis/\${komga.workspace} #logging: # level: # root: ERROR diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jms/ArtemisCleanup.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jms/ArtemisCleanup.kt deleted file mode 100644 index 15a62a76e..000000000 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jms/ArtemisCleanup.kt +++ /dev/null @@ -1,31 +0,0 @@ -package org.gotson.komga.infrastructure.jms - -import io.github.oshai.kotlinlogging.KotlinLogging -import org.springframework.beans.factory.InitializingBean -import org.springframework.beans.factory.annotation.Value -import org.springframework.stereotype.Service -import org.springframework.util.FileSystemUtils -import java.nio.file.Path -import kotlin.io.path.isDirectory - -private val logger = KotlinLogging.logger {} - -@Service -@Deprecated("To be removed") -class ArtemisCleanup( - @Value("\${spring.artemis.embedded.data-directory}") private val artemisDataDir: String? = null, -) : InitializingBean { - override fun afterPropertiesSet() { - try { - artemisDataDir?.let { - val artemisDataPath = Path.of(it) - if (artemisDataPath.isDirectory()) { - logger.info { "Deleting the legacy Artemis data-directory: $artemisDataPath" } - FileSystemUtils.deleteRecursively(artemisDataPath) - } - } - } catch (e: Exception) { - logger.warn(e) { "Failed to cleanup the Artemis directory" } - } - } -} diff --git a/komga/src/main/resources/application-localdb.yml b/komga/src/main/resources/application-localdb.yml index fff548599..2b03572aa 100644 --- a/komga/src/main/resources/application-localdb.yml +++ b/komga/src/main/resources/application-localdb.yml @@ -6,7 +6,3 @@ komga: data-directory: \${komga.config-dir}/lucene/\${komga.workspace} tasks-db: file: \${komga.config-dir}/\${komga.workspace}-tasks.sqlite -spring: - artemis: - embedded: - data-directory: \${komga.config-dir}/artemis/\${komga.workspace} diff --git a/komga/src/main/resources/application.yml b/komga/src/main/resources/application.yml index 33a1f79a1..d6dac635e 100644 --- a/komga/src/main/resources/application.yml +++ b/komga/src/main/resources/application.yml @@ -42,12 +42,6 @@ spring: mvc: async: request-timeout: 1h - # Deprecated - to remove along with ArtemisCleanup.kt - artemis: - broker-url: tcp://localhost:18515 - embedded: - persistent: true - data-directory: \${komga.config-dir}/artemis web: resources: add-mappings: false