fix(novel-crawl): 修复部分源无法停止的问题

This commit is contained in:
xiongxiaoyang 2025-05-12 17:48:24 +08:00
parent 4f474b91a8
commit 55d5deea74

View File

@ -256,7 +256,9 @@ public class CrawlServiceImpl implements CrawlService {
try {
String catIdRule = ruleBean.getCatIdRule().get("catId" + catId);
if (StringUtils.isNotBlank(catIdRule)) {
if (StringUtils.isBlank(catIdRule) || Thread.currentThread().isInterrupted()) {
return;
}
String catBookListUrl = "";
if (StringUtils.isNotBlank(ruleBean.getBookListUrl())) {
// 兼容老规则
@ -302,9 +304,6 @@ public class CrawlServiceImpl implements CrawlService {
totalPage = Integer.parseInt(totalPageMatcher.group(1));
}
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);