From e1386b4f2359d4c8634ab5932e48d7b75bf74bb3 Mon Sep 17 00:00:00 2001 From: davidhua Date: Fri, 6 Dec 2024 20:55:31 +0800 Subject: [PATCH] Fix the problem of blank exec user. --- .../builder/transform/GenericExchangisTransformJobBuilder.java | 3 ++- .../job/server/service/impl/DefaultJobExecuteService.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/GenericExchangisTransformJobBuilder.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/GenericExchangisTransformJobBuilder.java index 701a60040..07bbcd0dc 100644 --- a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/GenericExchangisTransformJobBuilder.java +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/builder/transform/GenericExchangisTransformJobBuilder.java @@ -83,7 +83,8 @@ public TransformExchangisJob buildJob(ExchangisJobInfo inputJob, TransformExchan inputJob.getName(), inputJob.getId(), inputJob.getEngineType(), inputJob.getJobContent()); //First to convert content to "ExchangisJobInfoContent" TransformExchangisJob outputJob = new TransformExchangisJob(); - outputJob.setCreateUser(Optional.ofNullable(inputJob.getExecuteUser()).orElse(String.valueOf(ctx.getEnv("USER_NAME")))); + outputJob.setCreateUser(StringUtils.isNotBlank(inputJob.getExecuteUser()) ? + inputJob.getExecuteUser() : String.valueOf(ctx.getEnv("USER_NAME"))); try { if (StringUtils.isNotBlank(inputJob.getJobContent())) { //First to convert content to "ExchangisJobInfoContent" diff --git a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultJobExecuteService.java b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultJobExecuteService.java index fdac6e932..806aa0337 100644 --- a/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultJobExecuteService.java +++ b/exchangis-job/exchangis-job-server/src/main/java/com/webank/wedatasphere/exchangis/job/server/service/impl/DefaultJobExecuteService.java @@ -357,6 +357,8 @@ public String executeJob(String requestUser, ExchangisJobInfo jobInfo, String ex } // Build generator scheduler task GenerationSchedulerTask schedulerTask = null; + // Importance +// jobInfo.setExecuteUser(execUser); try { schedulerTask = new GenerationSchedulerTask(taskGenerator, jobInfo); } catch (ExchangisTaskGenerateException e) {