Merge pull request #1193 from xyyz150/master

优化在JobThread尝试30次后销毁任务时,并发插入到triggerQueue中任务会失败的场景
This commit is contained in:
许雪里 2019-10-21 17:16:47 +08:00 committed by GitHub
commit 12ebcfd4fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -165,9 +165,11 @@ public class JobThread extends Thread{
} else { } else {
if (idleTimes > 30) { if (idleTimes > 30) {
if(triggerQueue ==null||triggerQueue.size()==0) {
XxlJobExecutor.removeJobThread(jobId, "excutor idel times over limit."); XxlJobExecutor.removeJobThread(jobId, "excutor idel times over limit.");
} }
} }
}
} catch (Throwable e) { } catch (Throwable e) {
if (toStop) { if (toStop) {
XxlJobLogger.log("<br>----------- JobThread toStop, stopReason:" + stopReason); XxlJobLogger.log("<br>----------- JobThread toStop, stopReason:" + stopReason);