From 4e52a56c30221b464cbf9d36f675a60ca8ef2a00 Mon Sep 17 00:00:00 2001 From: 王明元 <97082371@qq.com> Date: Thu, 30 Jun 2022 18:22:00 +0800 Subject: [PATCH] 2022年6月30日18:21:52 --- src/main/java/cn/fw/freya/task/DataCaptureTask.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/cn/fw/freya/task/DataCaptureTask.java b/src/main/java/cn/fw/freya/task/DataCaptureTask.java index 2a28b6b..3ad3b53 100644 --- a/src/main/java/cn/fw/freya/task/DataCaptureTask.java +++ b/src/main/java/cn/fw/freya/task/DataCaptureTask.java @@ -16,6 +16,7 @@ import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.ApplicationEventPublisher; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; @@ -50,7 +51,7 @@ public class DataCaptureTask { /** * 每分钟执行多线程同时抓取数据 */ - //@Scheduled(cron = "0 0/1 * * * ?") + @Scheduled(cron = "0 0/1 * * * ?") public void capture() { final ThreadPoolExecutor threadPoolExecutor = ThreadPoolUtil.getThreadPool(); BlockingQueue queue = threadPoolExecutor.getQueue();// 获取工作队列 @@ -96,7 +97,7 @@ public class DataCaptureTask { /** * 每2分钟执行抓取数据 */ - //@Scheduled(fixedRate = 2 * 60 * 1000, initialDelay = 5000) + @Scheduled(fixedRate = 2 * 60 * 1000, initialDelay = 5000) public void captureLivePlayback() { Double durationThreshold = 60d;// 设置直播时长阈值 final Random random = new Random(); -- libgit2 0.22.2