update - 优化异步任务执行的异常信息报告
This commit is contained in:
parent
90a5493ce7
commit
6cb1baf326
@ -48,6 +48,6 @@ public class SpringAsyncConfigurer extends AsyncConfigurerSupport {
|
||||
|
||||
@Override
|
||||
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
|
||||
return (ex, method, params) -> log.info(String.format("执行异步任务'%s'", method), ex);
|
||||
return (ex, method, params) -> log.error(String.format("执行异步任务出现异常'%s'", method), ex);
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,6 @@ import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -36,7 +35,6 @@ import static cn.azxo.framework.common.constatns.Constants.CTX_LOG_ID_MDC;
|
||||
@Component
|
||||
@Aspect
|
||||
@Slf4j
|
||||
@RefreshScope
|
||||
public class ErrorReportAspect implements Ordered {
|
||||
@Value("${spring.profiles.active}")
|
||||
private String profile;
|
||||
|
||||
@ -30,7 +30,7 @@ public class ErrorReporterEventListener implements BpmnAsyncExecutionErrorEventL
|
||||
} else if (Lists.newArrayList("live", "master").contains(profile)) {
|
||||
reporterType = ReporterType.ONLY_LOG;
|
||||
}
|
||||
reporterType.executeAction(profile, "异步任务执行异常", sendDingTalk, new Object[]{jobInfo}, "act_ru_job", throwable);
|
||||
reporterType.executeAction(profile, "异步任务执行异常, 剩余重试次数:" + jobInfo.getRetries(), sendDingTalk, new Object[]{jobInfo}, "act_ru_job", throwable);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user