mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-06-10 07:27:28 +00:00
fix: ShutdownHook 接入 JDBCPoolInit.close() 和 JsParserExecutor.shutdownExecutor()
将已实现但未调用的 close()/shutdownExecutor() 接入 JVM ShutdownHook,显式释放资源。 关闭顺序:vertx.close() → JDBC 连接池 → WorkerExecutor 线程池,确保依赖关系正确。
This commit is contained in:
@@ -147,6 +147,18 @@ public final class Deploy {
|
||||
} catch (Exception e) {
|
||||
LOGGER.warn("Vert.x close error or timeout", e);
|
||||
}
|
||||
// 显式关闭 JDBC 连接池(vertx.close 不保证关闭 JDBCPoolInit 管理的 pool)
|
||||
try {
|
||||
cn.qaiu.db.pool.JDBCPoolInit.instance().close();
|
||||
} catch (Exception e) {
|
||||
LOGGER.warn("JDBC pool close error", e);
|
||||
}
|
||||
// 显式关闭 JS 解析器 WorkerExecutor 线程池
|
||||
try {
|
||||
cn.qaiu.parser.customjs.JsParserExecutor.shutdownExecutor();
|
||||
} catch (Exception e) {
|
||||
LOGGER.warn("JsParserExecutor shutdown error", e);
|
||||
}
|
||||
}));
|
||||
//配置保存在共享数据中
|
||||
var sharedData = vertx.sharedData();
|
||||
|
||||
Reference in New Issue
Block a user