Refactor package structure and update dependencies
Renamed package structure to `nl.astraeus.tmpl` for consistency and modified the repository name placeholder. Updated Kotlin and library dependencies, removed unused imports, and adjusted Gradle settings for better project clarity.
This commit is contained in:
39
src/jvmMain/kotlin/nl/astraeus/tmpl/Main.kt
Normal file
39
src/jvmMain/kotlin/nl/astraeus/tmpl/Main.kt
Normal file
@@ -0,0 +1,39 @@
|
||||
package nl.astraeus.tmpl
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig
|
||||
import nl.astraeus.logger.Logger
|
||||
import nl.astraeus.tmpl.db.Database
|
||||
|
||||
val log = Logger()
|
||||
|
||||
val REPO_NAME = "dummy so the gitea template compiles, please remove"
|
||||
|
||||
fun main() {
|
||||
Thread.currentThread().uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { t, e ->
|
||||
log.warn(e) {
|
||||
e.message
|
||||
}
|
||||
}
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(
|
||||
object : Thread() {
|
||||
override fun run() {
|
||||
Database.vacuumDatabase()
|
||||
Database.closeDatabase()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
Class.forName("nl.astraeus.jdbc.Driver")
|
||||
Database.initialize(HikariConfig().apply {
|
||||
driverClassName = "nl.astraeus.jdbc.Driver"
|
||||
jdbcUrl = "jdbc:stat:webServerPort=6001:jdbc:sqlite:data/${REPO_NAME}.db"
|
||||
username = "sa"
|
||||
password = ""
|
||||
maximumPoolSize = 25
|
||||
isAutoCommit = false
|
||||
|
||||
validate()
|
||||
})
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user