From 9f8c2e8a2fe63147ae3fdb1c364a6f6a8baa5d53 Mon Sep 17 00:00:00 2001 From: Intelli Date: Mon, 26 Sep 2022 15:22:07 -0600 Subject: [PATCH] Set Hikari maxLifetime to 5m, keepaliveTime to 1m (fixes #199) --- src/main/java/net/coreprotect/config/ConfigHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/net/coreprotect/config/ConfigHandler.java b/src/main/java/net/coreprotect/config/ConfigHandler.java index 85c8180..9acfa64 100644 --- a/src/main/java/net/coreprotect/config/ConfigHandler.java +++ b/src/main/java/net/coreprotect/config/ConfigHandler.java @@ -229,6 +229,8 @@ public class ConfigHandler extends Queue { config.setJdbcUrl("jdbc:mysql://" + ConfigHandler.host + ":" + ConfigHandler.port + "/" + ConfigHandler.database); config.setUsername(ConfigHandler.username); config.setPassword(ConfigHandler.password); + config.setMaxLifetime(300000); + config.setKeepaliveTime(60000); config.addDataSourceProperty("characterEncoding", "UTF-8"); config.addDataSourceProperty("connectionTimeout", "10000"); /* https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration */