From d4230f32b06e87e9d277d9946149a848d8f6be53 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <773861846@qq.com> Date: Mon, 20 Jan 2020 10:55:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xyz/zinglizingli/books/core/crawl/BiquCrawlSource.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/novel-front/src/main/java/xyz/zinglizingli/books/core/crawl/BiquCrawlSource.java b/novel-front/src/main/java/xyz/zinglizingli/books/core/crawl/BiquCrawlSource.java index f3798a0..9009005 100644 --- a/novel-front/src/main/java/xyz/zinglizingli/books/core/crawl/BiquCrawlSource.java +++ b/novel-front/src/main/java/xyz/zinglizingli/books/core/crawl/BiquCrawlSource.java @@ -35,7 +35,7 @@ public class BiquCrawlSource extends BaseHtmlCrawlSource { Map newCat2Date = new HashMap<>(); for(int i=1;i<=7;i++) { Date lastUpdateTime = cat2Date.get(i); - Date updateTime = lastUpdateTime; + Date updateTime = null; int page = 1; do{ String catBookListUrl = getListPageUrl().replace("{0}", i+"").replace("{1}", page + ""); @@ -62,7 +62,7 @@ public class BiquCrawlSource extends BaseHtmlCrawlSource { boolean isBookNameMatch = bookNameMatch.find(); - while (isFind && scoreFind && isBookNameMatch && authorMatch.find() && updateTime.getTime()>lastUpdateTime.getTime()) { + while (isFind && scoreFind && isBookNameMatch && authorMatch.find() && (updateTime==null || updateTime.getTime()>lastUpdateTime.getTime())) { try { Float score = Float.parseFloat(scoreMatch.group(1)); @@ -116,7 +116,7 @@ public class BiquCrawlSource extends BaseHtmlCrawlSource { } } - }while (updateTime.getTime()>lastUpdateTime.getTime()); + }while (updateTime == null || updateTime.getTime()>lastUpdateTime.getTime()); } bookService.updateBookUpdateTimeLog(newCat2Date);