|
|
@@ -12,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import top.lvzhiqiang.entity.DicCode;
|
|
|
import top.lvzhiqiang.entity.VideoSitePool;
|
|
|
import top.lvzhiqiang.mapper.VideoSitePoolMapper;
|
|
|
+import top.lvzhiqiang.service.BgService;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
|
@@ -33,6 +34,9 @@ public class MyJobs {
|
|
|
@Resource
|
|
|
private VideoSitePoolMapper videoSitePoolMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private BgService bgService;
|
|
|
+
|
|
|
private static final String SCHEDULED_ZONE = "Asia/Shanghai";
|
|
|
|
|
|
/**
|
|
|
@@ -136,4 +140,24 @@ public class MyJobs {
|
|
|
|
|
|
log.info("checkVideoSite结束==============================");
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 每天20点Jsoup码池
|
|
|
+ */
|
|
|
+ @Scheduled(cron = "0 00 20 * * ?", zone = SCHEDULED_ZONE)
|
|
|
+ public void jsoupIcodePool4CrawingNo() {
|
|
|
+ log.info("jsoupIcodePool4CrawingNo开始==============================");
|
|
|
+
|
|
|
+ bgService.jsoupIcodePool(1, 2);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 每天6.30点Jsoup码池
|
|
|
+ */
|
|
|
+ @Scheduled(cron = "0 30 20 * * ?", zone = SCHEDULED_ZONE)
|
|
|
+ public void jsoupIcodePool4CrawingFail() {
|
|
|
+ log.info("jsoupIcodePool4CrawingFail开始==============================");
|
|
|
+
|
|
|
+ bgService.jsoupIcodePool(3, 2);
|
|
|
+ }
|
|
|
}
|