From d7b76135c8ca76ad5178768d716f42a1b24aa8db Mon Sep 17 00:00:00 2001 From: Intelli Date: Thu, 13 Jul 2023 18:07:15 -0600 Subject: [PATCH] Reduced MySQL connection lifetime from 5m to 1m (fix #362) --- src/main/java/net/coreprotect/config/ConfigHandler.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/net/coreprotect/config/ConfigHandler.java b/src/main/java/net/coreprotect/config/ConfigHandler.java index 58e58f7..d9f9944 100644 --- a/src/main/java/net/coreprotect/config/ConfigHandler.java +++ b/src/main/java/net/coreprotect/config/ConfigHandler.java @@ -230,8 +230,7 @@ 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.setMaxLifetime(60000); config.addDataSourceProperty("characterEncoding", "UTF-8"); config.addDataSourceProperty("connectionTimeout", "10000"); /* https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration */