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.
40 lines
880 B
Kotlin
40 lines
880 B
Kotlin
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()
|
|
})
|
|
|
|
}
|