mirror of
https://github.com/GayPizzaSpecifications/foundation.git
synced 2025-08-02 21:20:55 +00:00
Heimdall: Actually set max lifetime and pool size.
This commit is contained in:
parent
a184d2e845
commit
e3d9eb80fc
@ -21,6 +21,7 @@ import org.bukkit.event.player.*
|
||||
import org.bukkit.plugin.java.JavaPlugin
|
||||
import org.jetbrains.exposed.sql.Database
|
||||
import org.postgresql.Driver
|
||||
import java.time.Duration
|
||||
import java.time.Instant
|
||||
import java.util.*
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
@ -63,6 +64,8 @@ class FoundationHeimdallPlugin : JavaPlugin(), Listener {
|
||||
username = config.db.username
|
||||
password = config.db.password
|
||||
schema = "heimdall"
|
||||
maximumPoolSize = 10
|
||||
maxLifetime = Duration.ofMinutes(10).toMillis()
|
||||
})
|
||||
val initMigrationContent = FoundationHeimdallPlugin::class.java.getResourceAsStream(
|
||||
"/init.sql"
|
||||
|
@ -28,7 +28,7 @@ class GjallarhornCommand : CliktCommand(invokeWithoutSubcommand = true) {
|
||||
password = jdbcConnectionPassword
|
||||
minimumIdle = dbPoolSize / 2
|
||||
maximumPoolSize = dbPoolSize
|
||||
maxLifetime = Duration.ofHours(2).toMillis()
|
||||
maxLifetime = Duration.ofMinutes(10).toMillis()
|
||||
})
|
||||
val db = Database.connect(pool)
|
||||
currentContext.findOrSetObject { db }
|
||||
|
Loading…
Reference in New Issue
Block a user