refactor: 代码质量清理与日志规范化

- 替换 System.out.println/printStackTrace 为 Logger: MkgsTool, PodTool, WsTool, IpExtractor, ReqIpUtil, LogStatistics
- JsPlaygroundLogger 日志列表限制最大 1000 条防止内存泄漏
- JsScriptLoader JarFile 改用 try-with-resources 防止文件句柄泄漏
- DbServiceImpl Thread.sleep 改为 vertx.setTimer 避免阻塞 event loop
- 删除未使用的 api.js,删除空的 ParserApiClientLinkTest
- 移除前端未使用的导入和死代码 (downloaderService, monacoTypes)
- 提取 previewBaseUrl 到 constants.js 常量文件
This commit is contained in:
yukaidi
2026-05-29 14:23:26 +08:00
parent e36c0bbe45
commit 7b5900aae4
14 changed files with 76 additions and 183 deletions

View File

@@ -48,6 +48,6 @@ public class LogStatistics implements AfterInterceptor {
.execute(info)
.onSuccess(res -> {
log.info("inserted log: id={}, path={}, code={}", info.getId(), info.getPath(), info.getCode());
}).onFailure(Throwable::printStackTrace);
}).onFailure(e -> log.error("插入解析日志失败: id={}", info.getId(), e));
}
}

View File

@@ -42,12 +42,11 @@ public class DbServiceImpl implements DbService {
@Override
public Future<JsonObject> sayOk(String data) {
log.info("say ok1 -> wait...");
try {
Thread.sleep(4000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return Future.succeededFuture(JsonObject.mapFrom(JsonResult.data("Hi: " + data)));
Promise<JsonObject> promise = Promise.promise();
cn.qaiu.vx.core.util.VertxHolder.getVertxInstance().setTimer(4000, id -> {
promise.complete(JsonObject.mapFrom(JsonResult.data("Hi: " + data)));
});
return promise.future();
}
@Override