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();