mirror of
https://github.com/201206030/novel-plus.git
synced 2025-06-24 04:46:37 +00:00
perf: 预加载IdWorker
This commit is contained in:
@ -58,9 +58,10 @@ public class CrawlServiceImpl implements CrawlService {
|
||||
|
||||
private final BookService bookService;
|
||||
|
||||
|
||||
private final CacheService cacheService;
|
||||
|
||||
private final IdWorker idWorker = IdWorker.INSTANCE;
|
||||
|
||||
|
||||
@Override
|
||||
public void addCrawlSource(CrawlSource source) {
|
||||
@ -327,7 +328,7 @@ public class CrawlServiceImpl implements CrawlService {
|
||||
book.setCrawlBookId(bookId);
|
||||
book.setCrawlSourceId(sourceId);
|
||||
book.setCrawlLastTime(new Date());
|
||||
book.setId(IdWorker.INSTANCE.nextId());
|
||||
book.setId(idWorker.nextId());
|
||||
//解析章节目录
|
||||
boolean parseIndexContentResult = CrawlParser.parseBookIndexAndContent(bookId, book, ruleBean, new HashMap<>(0), chapter -> {
|
||||
bookService.saveBookAndIndexAndContent(book, chapter.getBookIndexList(), chapter.getBookContentList());
|
||||
|
Reference in New Issue
Block a user