更新间隔外部配置

This commit is contained in:
xiongxiaoyang 2020-01-16 10:32:34 +08:00
parent d898e412c7
commit 05dcf7056b
2 changed files with 7 additions and 3 deletions

View File

@ -31,6 +31,9 @@ public class StartListener implements ServletContextListener {
@Value("${website.domain}")
private String webSiteDomain;
@Value("${books.updatePeriod}")
private float bookUpdatePeriod;
private final SeoConfig seoConfig;
@ -49,8 +52,7 @@ public class StartListener implements ServletContextListener {
log.info("parseBooks执行中。。。。。。。。。。。。");
crawlSource.parse();
Thread.sleep(1000 * 60 * 5);
Thread.sleep(new Float(1000 * 60 * bookUpdatePeriod).longValue());
} catch (Exception e) {
log.error(e.getMessage(), e);
}

View File

@ -65,9 +65,11 @@ index:
mysql:
charset: utf8mb4
#爬取小说数据的最低评分
books:
#爬取小说数据的最低评分
lowestScore: 6.0
#小说的更新间隔(分)
updatePeriod: 5
#爬取的网站名称类型 1笔趣岛 2笔趣塔,3:顶点小说 更多网站解析中,敬请期待
crawl: