mirror of
				https://github.com/GayPizzaSpecifications/foundation.git
				synced 2025-11-04 11:39:39 +00:00 
			
		
		
		
	Heimdall: Actually set max lifetime and pool size.
This commit is contained in:
		@ -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 }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user