fix: 定时任务死锁问题
This commit is contained in:
parent
40780b9158
commit
0b8aeeaef2
|
@ -39,18 +39,6 @@ public class ScheduleManager {
|
|||
.startNow().build();
|
||||
|
||||
scheduler.scheduleJob(jd, trigger);
|
||||
|
||||
try {
|
||||
|
||||
if (!scheduler.isShutdown()) {
|
||||
scheduler.start();
|
||||
}
|
||||
|
||||
} catch (SchedulerException e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void addSimpleJob(JobKey jobKey, TriggerKey triggerKey, Class<? extends Job> cls, int repeatIntervalTime) throws SchedulerException {
|
||||
|
@ -89,9 +77,6 @@ public class ScheduleManager {
|
|||
|
||||
scheduler.scheduleJob(jobDetail, trigger);
|
||||
|
||||
if (!scheduler.isShutdown()) {
|
||||
scheduler.start();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
throw new RuntimeException(e);
|
||||
|
|
|
@ -19,7 +19,7 @@ public class AppStartListener implements ApplicationListener<ApplicationReadyEve
|
|||
System.out.println("================= 应用启动 =================");
|
||||
|
||||
try {
|
||||
Thread.sleep(5 * 60 * 1000);
|
||||
Thread.sleep(3 * 60 * 1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue