From b34de975fcad4ee3b8e8a80a1215aa68f3dd1256 Mon Sep 17 00:00:00 2001 From: Andrew Charneski Date: Mon, 3 Jun 2024 22:02:02 -0500 Subject: [PATCH] 1.0.76 (#81) * 1.0.76 * Update ApplicationServices.kt --- core/build.gradle.kts | 2 +- .../skyenet/core/platform/ApplicationServices.kt | 1 + .../skyenet/core/platform/HSQLUsageManager.kt | 13 ++++++------- gradle.properties | 2 +- webui/build.gradle.kts | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 3be708ce..835d4025 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -33,7 +33,7 @@ val hsqldb_version = "2.7.2" dependencies { - implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.0.57") + implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.0.60") implementation(group = "org.hsqldb", name = "hsqldb", version = hsqldb_version) implementation("org.apache.commons:commons-text:1.11.0") diff --git a/core/src/main/kotlin/com/simiacryptus/skyenet/core/platform/ApplicationServices.kt b/core/src/main/kotlin/com/simiacryptus/skyenet/core/platform/ApplicationServices.kt index 3b6478d7..d61d8e2d 100644 --- a/core/src/main/kotlin/com/simiacryptus/skyenet/core/platform/ApplicationServices.kt +++ b/core/src/main/kotlin/com/simiacryptus/skyenet/core/platform/ApplicationServices.kt @@ -84,6 +84,7 @@ interface AuthenticationInterface { fun putUser(accessToken: String, user: User): User fun logout(accessToken: String, user: User) + //fun removeToken(accessToken: String) companion object { const val AUTH_COOKIE = "sessionId" diff --git a/core/src/main/kotlin/com/simiacryptus/skyenet/core/platform/HSQLUsageManager.kt b/core/src/main/kotlin/com/simiacryptus/skyenet/core/platform/HSQLUsageManager.kt index 15773ab0..0d6401d3 100644 --- a/core/src/main/kotlin/com/simiacryptus/skyenet/core/platform/HSQLUsageManager.kt +++ b/core/src/main/kotlin/com/simiacryptus/skyenet/core/platform/HSQLUsageManager.kt @@ -15,18 +15,17 @@ import java.util.concurrent.atomic.AtomicInteger class HSQLUsageManager(private val dbFile: File) : UsageInterface { - private val connection: Connection - private val logger: Logger = LoggerFactory.getLogger(HSQLUsageManager::class.java) - - init { + private val connection: Connection by lazy { logger.info("Initializing HSQLUsageManager with database file: ${dbFile.absolutePath}") Class.forName("org.hsqldb.jdbc.JDBCDriver") - connection = DriverManager.getConnection("jdbc:hsqldb:file:${dbFile.absolutePath};shutdown=true", "SA", "") + val connection = DriverManager.getConnection("jdbc:hsqldb:file:${dbFile.absolutePath};shutdown=true", "SA", "") logger.debug("Database connection established: $connection") - createSchema() + createSchema(connection) + connection } + private val logger: Logger = LoggerFactory.getLogger(HSQLUsageManager::class.java) - private fun createSchema() { + private fun createSchema(connection: Connection) { logger.info("Creating database schema if not exists") connection.createStatement().executeUpdate( """ diff --git a/gradle.properties b/gradle.properties index 5a04f646..ff687e2a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ # Gradle Releases -> https://github.com/gradle/gradle/releases libraryGroup = com.simiacryptus.skyenet -libraryVersion = 1.0.75 +libraryVersion = 1.0.76 gradleVersion = 7.6.1 diff --git a/webui/build.gradle.kts b/webui/build.gradle.kts index 3bf5d7fa..99791311 100644 --- a/webui/build.gradle.kts +++ b/webui/build.gradle.kts @@ -35,7 +35,7 @@ val jetty_version = "11.0.18" val jackson_version = "2.17.0" dependencies { - implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.0.57") + implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.0.60") implementation(project(":core")) implementation(project(":kotlin"))