Commit 4bf69658 by huangfusuper

执行失败也执行结束周期回调

parent 6946e60e
...@@ -1667,8 +1667,8 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -1667,8 +1667,8 @@ public class ApiFlowServiceImpl implements ApiFlowService {
StringBuffer runids = new StringBuffer(); StringBuffer runids = new StringBuffer();
//暂停工作流调度 //暂停工作流调度
recordingList.forEach(runRecording -> { recordingList.forEach(runRecording -> {
if (RunRecordingEnum.FLOW_STATUS_IS_END.getCode().equals(runRecording.getFlowStatus())) { if (RunRecordingEnum.FAIL_FAST_YES.getCode().equals(runRecording.getFailFast())) {
throw new RuntimeException(String.format("实例%s是完结状态", runRecording.getFlowName())); throw new RuntimeException(String.format("实例%s是快速失败状态", runRecording.getFlowName()));
} }
//runRecordingMapper.stopByRunIdAndFlowId(runRecording.getRunId(), runRecording.getFlowId()); //runRecordingMapper.stopByRunIdAndFlowId(runRecording.getRunId(), runRecording.getFlowId());
runRecordingMapper.stopByRunIdAndFlowId(runRecording.getRunId(), runRecording.getFlowId()); runRecordingMapper.stopByRunIdAndFlowId(runRecording.getRunId(), runRecording.getFlowId());
......
...@@ -127,8 +127,8 @@ public class RunNodeServiceImpl implements RunNodeServer, ApplicationEventPublis ...@@ -127,8 +127,8 @@ public class RunNodeServiceImpl implements RunNodeServer, ApplicationEventPublis
} catch (Exception e) { } catch (Exception e) {
String format = String.format(RedisKeyNameEnum.REDIS_FLOW_ERROR_MSG_KEY.getKeyName(), build.getRunId(), build.getFlowName()); String format = String.format(RedisKeyNameEnum.REDIS_FLOW_ERROR_MSG_KEY.getKeyName(), build.getRunId(), build.getFlowName());
stringRedisTemplate.opsForValue().set(format, MythLogUtils.getMessage(e)); stringRedisTemplate.opsForValue().set(format, MythLogUtils.getMessage(e));
build.setFlowStatus(RunRecordingEnum.FLOW_STATUS_IS_END.getCode()); // build.setFlowStatus(RunRecordingEnum.FLOW_STATUS_IS_END.getCode());
build.setFlowRunResult(RunResultEnum.RUN_ERROR.getCode()); // build.setFlowRunResult(RunResultEnum.RUN_ERROR.getCode());
build.setFailFast(RunRecordingEnum.FAIL_FAST_YES.getCode()); build.setFailFast(RunRecordingEnum.FAIL_FAST_YES.getCode());
build.setStartTime(new Date()); build.setStartTime(new Date());
build.setEndTime(new Date()); build.setEndTime(new Date());
......
...@@ -287,8 +287,8 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask ...@@ -287,8 +287,8 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
}catch (Exception e) { }catch (Exception e) {
String format = String.format(RedisKeyNameEnum.REDIS_FLOW_ERROR_MSG_KEY.getKeyName(), runRecording.getRunId(), runRecording.getFlowName()); String format = String.format(RedisKeyNameEnum.REDIS_FLOW_ERROR_MSG_KEY.getKeyName(), runRecording.getRunId(), runRecording.getFlowName());
stringRedisTemplate.opsForValue().set(format, MythLogUtils.getMessage(e)); stringRedisTemplate.opsForValue().set(format, MythLogUtils.getMessage(e));
runRecording.setFlowStatus(RunRecordingEnum.FLOW_STATUS_IS_END.getCode()); // runRecording.setFlowStatus(RunRecordingEnum.FLOW_STATUS_IS_END.getCode());
runRecording.setFlowRunResult(RunResultEnum.RUN_ERROR.getCode()); // runRecording.setFlowRunResult(RunResultEnum.RUN_ERROR.getCode());
runRecording.setFailFast(RunRecordingEnum.FAIL_FAST_YES.getCode()); runRecording.setFailFast(RunRecordingEnum.FAIL_FAST_YES.getCode());
runRecording.setStartTime(new Date()); runRecording.setStartTime(new Date());
runRecording.setEndTime(new Date()); runRecording.setEndTime(new Date());
......
...@@ -5,18 +5,16 @@ import com.alibaba.fastjson.JSON; ...@@ -5,18 +5,16 @@ import com.alibaba.fastjson.JSON;
import com.byit.conf.MythJobAutoConfigure; import com.byit.conf.MythJobAutoConfigure;
import com.byit.dto.BeanStrategyPackage; import com.byit.dto.BeanStrategyPackage;
import com.byit.dto.executor.DispatchResponseDto; import com.byit.dto.executor.DispatchResponseDto;
import com.byit.dto.executor.RunParamWrapped;
import com.byit.dto.executor.ScriptDto; import com.byit.dto.executor.ScriptDto;
import com.byit.dto.executor.ScriptParamAndPlaceholderDto;
import com.byit.dto.plugin.RunLog; import com.byit.dto.plugin.RunLog;
import com.byit.enums.*; import com.byit.enums.EmailEnum;
import com.byit.enums.JobResultEnum;
import com.byit.enums.NodePropertyEnum;
import com.byit.enums.task.RunResultEnum; import com.byit.enums.task.RunResultEnum;
import com.byit.enums.task.RunTypeEnum; import com.byit.enums.task.RunTypeEnum;
import com.byit.filesystem.FastDfsFileSystem; import com.byit.filesystem.FastDfsFileSystem;
import com.byit.filesystem.FileSystem; import com.byit.filesystem.FileSystem;
import com.byit.job.utils.DateUtil;
import com.byit.job.utils.MythLogUtils; import com.byit.job.utils.MythLogUtils;
import com.byit.job.utils.PlaceholderUtils;
import com.byit.model.JobTaskRunLogWithBLOBs; import com.byit.model.JobTaskRunLogWithBLOBs;
import com.byit.model.JobTaskSchedule; import com.byit.model.JobTaskSchedule;
import com.byit.service.FastRunLogService; import com.byit.service.FastRunLogService;
...@@ -107,8 +105,8 @@ public class ScriptExecutorJobTask implements TimerTask { ...@@ -107,8 +105,8 @@ public class ScriptExecutorJobTask implements TimerTask {
Map<String, TaskRunTheLifeCycleCallback> stringTaskRunTheLifeCycleCallbackMap = SpringUtil.getBeansOfType(TaskRunTheLifeCycleCallback.class); Map<String, TaskRunTheLifeCycleCallback> stringTaskRunTheLifeCycleCallbackMap = SpringUtil.getBeansOfType(TaskRunTheLifeCycleCallback.class);
//数据排序 //数据排序
List<BeanStrategyPackage<TaskRunTheLifeCycleCallback>> beanStrategyPackages = ClassSortUtil.objectSort(stringTaskRunTheLifeCycleCallbackMap); List<BeanStrategyPackage<TaskRunTheLifeCycleCallback>> beanStrategyPackages = ClassSortUtil.objectSort(stringTaskRunTheLifeCycleCallbackMap);
beanStrategyPackages.forEach(beanStrategyPackage ->{ beanStrategyPackages.forEach(beanStrategyPackage -> {
log.info("--------------脚本节点生命周期开始回调{}--------------",beanStrategyPackage.getBeanName()); log.info("--------------脚本节点生命周期开始回调{}--------------", beanStrategyPackage.getBeanName());
TaskRunTheLifeCycleCallback beanStrategyPackageBean = beanStrategyPackage.getBean(); TaskRunTheLifeCycleCallback beanStrategyPackageBean = beanStrategyPackage.getBean();
if (beanStrategyPackageBean.matchType(this.mythJobTaskSchedule)) { if (beanStrategyPackageBean.matchType(this.mythJobTaskSchedule)) {
beanStrategyPackageBean.postProcessAfterInitialization(this.mythJobTaskSchedule); beanStrategyPackageBean.postProcessAfterInitialization(this.mythJobTaskSchedule);
......
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