Commit 9f4e94deb1812bf810e9934bce8be7f1bd86a7a2
Committed by
GitHub
Merge pull request #694 from shanaiardor/fix/tenantjob-aspect-voidretuenfail
修复由于多租户定时任务方法返回 void 导致的 xxlJob 任务执行失败的问题
Showing
1 changed file
with
1 additions
and
1 deletions
yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/job/TenantJobAspect.java
| @@ -46,7 +46,7 @@ public class TenantJobAspect { | @@ -46,7 +46,7 @@ public class TenantJobAspect { | ||
| 46 | TenantUtils.execute(tenantId, () -> { | 46 | TenantUtils.execute(tenantId, () -> { |
| 47 | try { | 47 | try { |
| 48 | Object result = joinPoint.proceed(); | 48 | Object result = joinPoint.proceed(); |
| 49 | - results.put(tenantId, StrUtil.toStringOrNull(result)); | 49 | + results.put(tenantId, StrUtil.toStringOrEmpty(result)); |
| 50 | } catch (Throwable e) { | 50 | } catch (Throwable e) { |
| 51 | log.error("[execute][租户({}) 执行 Job 发生异常", tenantId, e); | 51 | log.error("[execute][租户({}) 执行 Job 发生异常", tenantId, e); |
| 52 | results.put(tenantId, ExceptionUtil.getRootCauseMessage(e)); | 52 | results.put(tenantId, ExceptionUtil.getRootCauseMessage(e)); |