mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
fix: Cyclic Logging on Exception #769
This commit is contained in:
parent
1ba74bf0af
commit
4be6a139dd
@ -67,8 +67,11 @@ public class CoreScheduleTaskManager implements InitializingBean, DisposableBean
|
||||
log.info("start task : {}.", taskName);
|
||||
while (true) {
|
||||
try {
|
||||
innerRunnable.run();
|
||||
|
||||
// 倒置顺序为 先 sleep 再执行,解决异常情况 while true 打日志的问题 https://github.com/PowerJob/PowerJob/issues/769
|
||||
Thread.sleep(runningInterval);
|
||||
|
||||
innerRunnable.run();
|
||||
} catch (InterruptedException e) {
|
||||
log.warn("[{}] task has been interrupted!", taskName, e);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user