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 d9da4ff..22886ce 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,18 +100,21 @@ 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("路径不存在"); - Buffer buffer = VertxHolder.getVertxInstance().fileSystem().readFileBlocking(resource.getPath()); - JsonObject entries = new JsonObject(buffer); - Map map = entries.getMap(); - LocalConstant.put(configName, map); - LOGGER.info("读取配置{}成功", configName); + 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)); } public static Set sortClassSet(Set> set) {