Unverified Commit 6e832bc4 authored by gaoyan's avatar gaoyan Committed by GitHub

[Optimize][Admin]Optimize the process (#2420)

* Optimize the process * forme code
parent b5b25763
......@@ -27,6 +27,8 @@ import org.dinky.process.enums.ProcessStatus;
import org.dinky.process.enums.ProcessStepType;
import org.dinky.process.enums.ProcessType;
import org.apache.http.util.TextUtils;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
......@@ -82,6 +84,15 @@ public class ProcessAspect {
@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);
......
......@@ -202,6 +202,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
return jobResult;
}
@ProcessStep(type = ProcessStepType.SUBMIT_BUILD_CONFIG)
public JobConfig buildJobConfig(TaskDTO task) {
task.setStatement(buildEnvSql(task) + task.getStatement());
JobConfig config = task.getJobConfig();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment