RetryableTask: 避免最后一次任务执行时的线程睡眠

This commit is contained in:
Toint
2025-05-18 19:25:41 +08:00
parent e91dc5b756
commit b9cedd8798

View File

@@ -236,8 +236,11 @@ public class RetryableTask<T> {
break; break;
} }
// 避免最后一次任务执行时的线程睡眠
if (this.maxAttempts > 0) {
ThreadUtil.sleep(delay.toMillis()); ThreadUtil.sleep(delay.toMillis());
} }
}
this.throwable = th; this.throwable = th;
return this; return this;