From 1c2291f9cf183145b5cd7afdf0acd92be5708a60 Mon Sep 17 00:00:00 2001 From: yukaidi Date: Fri, 29 May 2026 00:37:27 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix(performance):=20CommonUtil=20init?= =?UTF-8?q?Config=20=E6=94=B9=E4=B8=BA=E5=BC=82=E6=AD=A5=E9=9D=9E=E9=98=BB?= =?UTF-8?q?=E5=A1=9E=E8=AF=BB=E5=8F=96"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6dfa7701372e7bbdf5cd65d4083b227e02943249. --- .../java/cn/qaiu/vx/core/util/CommonUtil.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/cn/qaiu/vx/core/util/CommonUtil.java b/core/src/main/java/cn/qaiu/vx/core/util/CommonUtil.java index 22886ce..d9da4ff 100644 --- a/core/src/main/java/cn/qaiu/vx/core/util/CommonUtil.java +++ b/core/src/main/java/cn/qaiu/vx/core/util/CommonUtil.java @@ -100,21 +100,18 @@ public class CommonUtil { } /** - * 处理其他配置(异步非阻塞方式) + * 处理其他配置 * * @param configName configName */ public static void initConfig(String configName, Class tClass) { URL resource = tClass.getResource("/conf/" + configName); if (resource == null) throw new RuntimeException("路径不存在"); - VertxHolder.getVertxInstance().fileSystem().readFile(resource.getPath()) - .onSuccess(buffer -> { - JsonObject entries = new JsonObject(buffer); - Map map = entries.getMap(); - LocalConstant.put(configName, map); - LOGGER.info("读取配置{}成功", configName); - }) - .onFailure(err -> LOGGER.error("读取配置{}失败", configName, err)); + Buffer buffer = VertxHolder.getVertxInstance().fileSystem().readFileBlocking(resource.getPath()); + JsonObject entries = new JsonObject(buffer); + Map map = entries.getMap(); + LocalConstant.put(configName, map); + LOGGER.info("读取配置{}成功", configName); } public static Set sortClassSet(Set> set) {