public void beforeDispatch(MvcEvent mvce) {
try {
if(mvce.getAppEvent() instanceof DebugFailEvent){
final DebugFailEvent event=(DebugFailEvent) mvce.getAppEvent();
DebugHistory history=event.getHistory();
FileDescriptor fd=fileManager.getFile(history.getFileId());
String msg="调试任务:"+fd.getName()+" 运行失败";
//此处可以发送IM消息
}else if(mvce.getAppEvent() instanceof DebugSuccessEvent){
final DebugSuccessEvent event=(DebugSuccessEvent) mvce.getAppEvent();
DebugHistory history=event.getHistory();
FileDescriptor fd=fileManager.getFile(history.getFileId());
String msg="调试任务:"+fd.getName()+" 运行成功";
//此处可以发送IM消息
}
} catch (Exception e) {
//处理异常,防止后续的依赖任务受此影响,无法正常执行
log.error("失败任务,发送通知出现异常",e);