修复由于多租户定时任务方法返回 void 导致的执行 xxlJob 执行失败的问题

This commit is contained in:
wct 2024-11-06 17:32:35 +08:00
parent 8aaa96c887
commit 72d2d81d6a
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ public class TenantJobAspect {
TenantUtils.execute(tenantId, () -> { TenantUtils.execute(tenantId, () -> {
try { try {
Object result = joinPoint.proceed(); Object result = joinPoint.proceed();
results.put(tenantId, StrUtil.toStringOrNull(result)); results.put(tenantId, StrUtil.toStringOrEmpty(result));
} catch (Throwable e) { } catch (Throwable e) {
log.error("[execute][租户({}) 执行 Job 发生异常", tenantId, e); log.error("[execute][租户({}) 执行 Job 发生异常", tenantId, e);
results.put(tenantId, ExceptionUtil.getRootCauseMessage(e)); results.put(tenantId, ExceptionUtil.getRootCauseMessage(e));