mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
RetryableTask: 避免最后一次任务执行时的线程睡眠
This commit is contained in:
@@ -236,7 +236,10 @@ public class RetryableTask<T> {
|
||||
break;
|
||||
}
|
||||
|
||||
ThreadUtil.sleep(delay.toMillis());
|
||||
// 避免最后一次任务执行时的线程睡眠
|
||||
if (this.maxAttempts > 0) {
|
||||
ThreadUtil.sleep(delay.toMillis());
|
||||
}
|
||||
}
|
||||
|
||||
this.throwable = th;
|
||||
|
Reference in New Issue
Block a user