From c2ce16fcecd3983421ea7c0c763fe5bcac9de55b Mon Sep 17 00:00:00 2001 From: blackflash997 <52345108+blackflash997997@users.noreply.github.com> Date: Thu, 15 Aug 2024 08:55:24 +0800 Subject: [PATCH] =?UTF-8?q?[Improvement][worker]=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=BA=90=E6=96=87=E4=BB=B6=E4=B8=8D=E5=AD=98=E5=9C=A8=EF=BC=8C?= =?UTF-8?q?=E5=88=99=E8=BD=AF=E9=93=BE=E6=8E=A5=E5=88=9B=E5=BB=BA=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=20(#599)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Improvement][service] Remove fixed component versions * [Improvement][api]优化ALERTMANAGER安装 * [Bug][service] HADOOP_HOME变量失效 * Revert "[Improvement][api]优化ALERTMANAGER安装" This reverts commit 3e9a13e0e507391c24fd8149a6b82de0d80c3fff. * 恢复代码 * [Improvement][api]优化alertmanager安装过程 * [Improvement][worker]Fix-源文件不存在,则软链接创建失败 * no message --- .../worker/strategy/resource/LinkStrategy.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/datasophon-worker/src/main/java/com/datasophon/worker/strategy/resource/LinkStrategy.java b/datasophon-worker/src/main/java/com/datasophon/worker/strategy/resource/LinkStrategy.java index 49e5a772..8376b47a 100644 --- a/datasophon-worker/src/main/java/com/datasophon/worker/strategy/resource/LinkStrategy.java +++ b/datasophon-worker/src/main/java/com/datasophon/worker/strategy/resource/LinkStrategy.java @@ -26,11 +26,15 @@ public void exec() { String realTarget = basePath + Constants.SLASH + target; File sourceFile = new File(source); File targetFile = new File(realTarget); - if (!targetFile.exists() && sourceFile.exists()) { - // 先创建文件夹 - FileUtil.mkdir(targetFile.getParent()); - ShellUtils.exceShell("ln -s " + source + " " + realTarget); - log.info("Create symbolic dir: {} to {}", source, realTarget); + FileUtil.mkdir(targetFile.getParent()); + ShellUtils.exceShell("ln -s " + source + " " + realTarget); + + if (!targetFile.exists()) { + if (sourceFile.exists()) { + log.info("Create existing symbolic dir: {} to {}", source, realTarget); + } else { + log.warn("Create non-existent symbolic dir: {} to {}", source, realTarget); + } } } -} +} \ No newline at end of file