From 45dfc054101ea8c890f9fd545224dd57d4c176ba Mon Sep 17 00:00:00 2001 From: Andrew Charneski Date: Fri, 15 Nov 2024 02:45:15 -0500 Subject: [PATCH] Update HSQLMetadataStorage.kt --- .../skyenet/core/platform/hsql/HSQLMetadataStorage.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/kotlin/com/simiacryptus/skyenet/core/platform/hsql/HSQLMetadataStorage.kt b/core/src/main/kotlin/com/simiacryptus/skyenet/core/platform/hsql/HSQLMetadataStorage.kt index b188e2d0..386eb0be 100644 --- a/core/src/main/kotlin/com/simiacryptus/skyenet/core/platform/hsql/HSQLMetadataStorage.kt +++ b/core/src/main/kotlin/com/simiacryptus/skyenet/core/platform/hsql/HSQLMetadataStorage.kt @@ -14,7 +14,7 @@ class HSQLMetadataStorage(private val dbFile: File) : MetadataStorageInterface { private val log = LoggerFactory.getLogger(javaClass) private val connection: Connection by lazy { - require(dbFile.absoluteFile.mkdirs()) { "Unable to create database directory: ${dbFile.absolutePath}" } + require(dbFile.absoluteFile.exists() || dbFile.absoluteFile.mkdirs()) { "Unable to create database directory: ${dbFile.absolutePath}" } log.info("Initializing HSQLMetadataStorage with database file: ${dbFile.absolutePath}") Class.forName("org.hsqldb.jdbc.JDBCDriver") val connection = DriverManager.getConnection("jdbc:hsqldb:file:${dbFile.absolutePath}/metadata;shutdown=true", "SA", "")