fix(tenant): 修复多租户定时任务执行结果为空时的异常
- 针对执行结果为 null 的情况增加了日志记录 - 为了避免 ConcurrentHashMap put空指针异常,将 result 设置为空字符串pull/201/head
parent
50e47434bb
commit
94a18018ae
|
@ -50,6 +50,12 @@ public class TenantJobAspect {
|
|||
TenantUtils.execute(tenantId, () -> {
|
||||
try {
|
||||
Object result = joinPoint.proceed();
|
||||
if(null == result){
|
||||
XxlJobHelper.log(StrUtil.format("[多租户({}) 执行任务({}),结果为:null]",
|
||||
tenantId, joinPoint.getSignature()));
|
||||
//避免ConcurrentHashMap put空指针异常
|
||||
result = "";
|
||||
}
|
||||
results.put(tenantId, StrUtil.toStringOrEmpty(result));
|
||||
} catch (Throwable e) {
|
||||
results.put(tenantId, ExceptionUtil.getRootCauseMessage(e));
|
||||
|
|
Loading…
Reference in New Issue