mirror of
https://github.com/gotson/komga.git
synced 2025-01-07 03:07:16 +08:00
fix: ensure database parent directory is always created
This commit is contained in:
parent
32ef331689
commit
fdd6fff0ba
@ -1,5 +1,6 @@
|
||||
package org.gotson.komga.infrastructure.configuration
|
||||
|
||||
import jakarta.annotation.PostConstruct
|
||||
import jakarta.validation.constraints.NotBlank
|
||||
import jakarta.validation.constraints.Positive
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties
|
||||
@ -9,11 +10,21 @@ import org.springframework.validation.annotation.Validated
|
||||
import org.sqlite.SQLiteConfig.JournalMode
|
||||
import java.time.Duration
|
||||
import java.time.temporal.ChronoUnit
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.createDirectories
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "komga")
|
||||
@Validated
|
||||
class KomgaProperties {
|
||||
@PostConstruct
|
||||
private fun makeDirs() {
|
||||
try {
|
||||
Path(database.file).parent.createDirectories()
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
var librariesScanCron: String = ""
|
||||
|
||||
var librariesScanStartup: Boolean = false
|
||||
|
Loading…
Reference in New Issue
Block a user