mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-06-10 23:47:29 +00:00
Revert "fix(performance): CommonUtil initConfig 改为异步非阻塞读取"
This reverts commit 6dfa770137.
This commit is contained in:
@@ -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<String, Object> 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<String, Object> map = entries.getMap();
|
||||
LocalConstant.put(configName, map);
|
||||
LOGGER.info("读取配置{}成功", configName);
|
||||
}
|
||||
|
||||
public static <T> Set<T> sortClassSet(Set<Class<? extends T>> set) {
|
||||
|
||||
Reference in New Issue
Block a user