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) {