Skip to content

Commit a01d813

Browse files
committed
set db connection timeout to 1 minute
1 parent b0fe903 commit a01d813

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/com/pangdata/apps/monitor/MysqlMariaDBMonitor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ private static Connection getConn() throws Exception {
330330
try {
331331
if (conn == null || conn.isClosed()) {
332332
Class.forName(JDBC_DRIVER);
333+
DriverManager.setLoginTimeout(60);
333334
conn = DriverManager.getConnection(DB_URL, USER, PASS);
334335
initVariables();
335336
}

0 commit comments

Comments
 (0)