mirror of
https://github.com/GayPizzaSpecifications/foundation.git
synced 2025-08-02 21:20:55 +00:00
Heimdall: Set DB pool max lifetime lower to prevent stale connections.
This commit is contained in:
parent
6e1afb5e5c
commit
a184d2e845
@ -7,6 +7,7 @@ import com.github.ajalt.clikt.parameters.types.int
|
||||
import com.zaxxer.hikari.HikariConfig
|
||||
import com.zaxxer.hikari.HikariDataSource
|
||||
import org.jetbrains.exposed.sql.Database
|
||||
import java.time.Duration
|
||||
|
||||
class GjallarhornCommand : CliktCommand(invokeWithoutSubcommand = true) {
|
||||
private val jdbcConnectionUrl by option("-c", "--connection-url", help = "JDBC Connection URL")
|
||||
@ -27,6 +28,7 @@ class GjallarhornCommand : CliktCommand(invokeWithoutSubcommand = true) {
|
||||
password = jdbcConnectionPassword
|
||||
minimumIdle = dbPoolSize / 2
|
||||
maximumPoolSize = dbPoolSize
|
||||
maxLifetime = Duration.ofHours(2).toMillis()
|
||||
})
|
||||
val db = Database.connect(pool)
|
||||
currentContext.findOrSetObject { db }
|
||||
|
Loading…
Reference in New Issue
Block a user