Skip to content

Commit

Permalink
Optimize the process
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoyan1998 committed Oct 21, 2023
1 parent b9b1396 commit 18d4216
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dinky-admin/src/main/java/org/dinky/aop/ProcessAspect.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.dinky.aop;

import org.apache.http.util.TextUtils;
import org.dinky.context.ConsoleContextHolder;
import org.dinky.process.annotations.ExecuteProcess;
import org.dinky.process.annotations.ProcessId;
Expand Down Expand Up @@ -82,6 +83,12 @@ public Object processAround(ProceedingJoinPoint joinPoint, ExecuteProcess execut
@Around(value = "@annotation(processStep)")
public Object processStepAround(ProceedingJoinPoint joinPoint, ProcessStep processStep) throws Throwable {

String processName = MDC.get(PROCESS_NAME);
if (TextUtils.isEmpty(processName)){
log.warn("Process {} does not exist, This registration step {} was abandoned", processName,processStep.type());
return joinPoint.proceed();
}

Object result;
// Record the current step and restore it after the execution is completed
String parentStep = MDC.get(PROCESS_STEP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ public JobResult executeJob(TaskDTO task) throws Exception {
return jobResult;
}

@ProcessStep(type = ProcessStepType.SUBMIT_BUILD_CONFIG)
public JobConfig buildJobConfig(TaskDTO task) {
task.setStatement(buildEnvSql(task) + task.getStatement());
JobConfig config = task.getJobConfig();
Expand Down

0 comments on commit 18d4216

Please sign in to comment.