修复目录订阅的定时刷新以及信令

This commit is contained in:
648540858
2021-11-16 18:15:33 +08:00
parent c49f6f8337
commit 5d5e5a164f
6 changed files with 15 additions and 24 deletions

View File

@@ -26,9 +26,10 @@ public class DynamicTask {
return new ThreadPoolTaskScheduler();
}
public String startCron(String key, Runnable task, String corn) {
public String startCron(String key, Runnable task, int cycleForCatalog) {
stopCron(key);
ScheduledFuture future = threadPoolTaskScheduler.schedule(task, new CronTrigger(corn));
// scheduleWithFixedDelay 必须等待上一个任务结束才开始计时period cycleForCatalog表示执行的间隔
ScheduledFuture future = threadPoolTaskScheduler.scheduleWithFixedDelay(task, cycleForCatalog * 1000L);
futureMap.put(key, future);
return "startCron";
}