diff --git a/src/main/java/com/xkrs/common/StaticScheduleTask.java b/src/main/java/com/xkrs/common/StaticScheduleTask.java new file mode 100644 index 0000000..6213695 --- /dev/null +++ b/src/main/java/com/xkrs/common/StaticScheduleTask.java @@ -0,0 +1,26 @@ +package com.xkrs.common; + +import com.xkrs.straw.utils.FirePointSubscribeManager; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; + +import javax.annotation.Resource; + +/** + * 更新订阅计划任务 + */ +@Configuration +@EnableScheduling +public class StaticScheduleTask { + + @Resource + private FirePointSubscribeManager firePointSubscribeManager; + + //每两小时更新一次订阅 + @Scheduled(cron = "0 0 */2 * * ?") + private void syncSubscribe() { + firePointSubscribeManager.autoSync(); + } + +} \ No newline at end of file