From 57c673aa3e83677bcf5d30b4b45d06bae6609db8 Mon Sep 17 00:00:00 2001 From: liusuyi <1951119284@qq.com> Date: 星期四, 08 八月 2024 16:14:40 +0800 Subject: [PATCH] 优化:获取会话 --- ard-work/src/main/java/com/ruoyi/storage/minio/service/impl/StorageMinioEventServiceImpl.java | 49 +------------------------------------------------ 1 files changed, 1 insertions(+), 48 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/storage/minio/service/impl/StorageMinioEventServiceImpl.java b/ard-work/src/main/java/com/ruoyi/storage/minio/service/impl/StorageMinioEventServiceImpl.java index d88e965..5010b99 100644 --- a/ard-work/src/main/java/com/ruoyi/storage/minio/service/impl/StorageMinioEventServiceImpl.java +++ b/ard-work/src/main/java/com/ruoyi/storage/minio/service/impl/StorageMinioEventServiceImpl.java @@ -39,53 +39,6 @@ @Resource private StorageMinioEventMapper storageMinioEventMapper; - @Value("${minio.accessKey}") - String accessKey; - @Value("${minio.secretKey}") - String secretKey; - @Value("${minio.path}") - String path; - @Value("${minio.enabled}") - Boolean enabled; - String processName = "minio.exe"; - @PostConstruct - public void initMinio() { - if (enabled) { - log.debug("鍒濆鍖栧惎鍔╩inio"); - - if (Platform.isWindows()) { - String exePath = System.getProperty("user.dir") + File.separator + "lib" + File.separator + "minio" + File.separator + processName; - Map<String, String> env=new HashMap<>(); - env.put("MINIO_ROOT_USER",accessKey); - env.put("MINIO_ROOT_PASSWORD",secretKey); - List<String> cmd = new ArrayList<>(); - cmd.add(exePath); - cmd.add("server"); - cmd.add(path); - cmd.add("--console-address=0.0.0.0:9000"); - cmd.add("--address=0.0.0.0:9001"); - if (CmdUtils.isProcessRunning(processName)) { - // 杩涚▼宸茬粡鍦ㄨ繍琛岋紝缁撴潫璇ヨ繘绋� - CmdUtils.stopProcess(processName); - } - // 鍚姩鍚庡彴杩涚▼ - CmdUtils.commandStart(processName, cmd, env); - // 鍚姩cmd绐楀彛 - //String[] command = {"cmd", "/c", "start", exePath}; - //CmdUtils.commandStart(command); - } - } - } - @PreDestroy - public void destroyMinio() { - if (enabled) { - log.info("閿�姣乵inio"); - if (CmdUtils.isProcessRunning(processName)) { - // 杩涚▼宸茬粡鍦ㄨ繍琛岋紝缁撴潫璇ヨ繘绋� - CmdUtils.stopProcess(processName); - } - } - } /** * 鏌ヨ瀛樺偍浜嬩欢 @@ -155,7 +108,7 @@ return storageMinioEventMapper.deleteStorageMinioEventById(id); } - @Async + @Async("globalExecutor") @Override public void parseStorageMinioEvent(String message) { try { -- Gitblit v1.9.3