mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-06-10 23:47:29 +00:00
fix: ShutdownHook 中 JDBCPoolInit.instance() 添加 null 检查,防止未初始化时 NPE
安装引导模式下数据库可能未配置,JDBCPoolInit.instance() 为 null,直接调用 close() 会 NPE。
This commit is contained in:
@@ -149,7 +149,8 @@ public final class Deploy {
|
||||
}
|
||||
// 显式关闭 JDBC 连接池(vertx.close 不保证关闭 JDBCPoolInit 管理的 pool)
|
||||
try {
|
||||
cn.qaiu.db.pool.JDBCPoolInit.instance().close();
|
||||
var poolInit = cn.qaiu.db.pool.JDBCPoolInit.instance();
|
||||
if (poolInit != null) poolInit.close();
|
||||
} catch (Exception e) {
|
||||
LOGGER.warn("JDBC pool close error", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user