v2.1.0发布

This commit is contained in:
xiongxiaoyang 2020-05-21 09:15:47 +08:00
parent c2cdf73893
commit 9c78f400dc
2 changed files with 8 additions and 2 deletions

View File

@ -43,9 +43,9 @@ public class BookToEsSchedule {
private boolean lock = false;
/**
* 1分钟导入一次
* 2分钟导入一次
*/
@Scheduled(fixedRate = 1000 * 60)
@Scheduled(fixedRate = 1000 * 60 * 2)
public void saveToEs() {
if (!lock) {
lock = true;
@ -70,6 +70,8 @@ public class BookToEsSchedule {
jestClient.execute(action);
lastDate = book.getUpdateTime();
//1秒钟导入一本书1分钟导入60本
Thread.sleep(1000);
}

View File

@ -3,6 +3,7 @@ package com.java2nb.novel.core.schedule;
import com.java2nb.novel.entity.Book;
import com.java2nb.novel.service.BookService;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@ -34,6 +35,7 @@ public class Network2LocalPicSchedule {
* 10分钟转一次
*/
@Scheduled(fixedRate = 1000 * 60 * 10)
@SneakyThrows
public void trans() {
log.info("Network2LocalPicSchedule。。。。。。。。。。。。");
@ -42,6 +44,8 @@ public class Network2LocalPicSchedule {
List<Book> networkPicBooks = bookService.queryNetworkPicBooks(100);
for (Book book : networkPicBooks) {
bookService.updateBookPicToLocal(book.getPicUrl(), book.getId());
//3秒钟转化一张图片10分钟转化200张
Thread.sleep(3000);
}