|
|
@@ -42,6 +42,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import javax.annotation.PostConstruct;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
import java.time.temporal.TemporalUnit;
|
|
|
@@ -91,7 +92,7 @@ public class FsTagUpdateServiceImpl implements FsTagUpdateService {
|
|
|
/**
|
|
|
* 接口限流
|
|
|
*/
|
|
|
- private final RateLimiter rateLimiter = RateLimiter.create(RATE_LIMIT_NUM);
|
|
|
+ private RateLimiter rateLimiter;
|
|
|
|
|
|
/**
|
|
|
* 看课自动打标签开关
|
|
|
@@ -99,6 +100,11 @@ public class FsTagUpdateServiceImpl implements FsTagUpdateService {
|
|
|
@Value("${qw.enableAutoTag:0}")
|
|
|
private Integer enableAutoTag;
|
|
|
|
|
|
+ @PostConstruct
|
|
|
+ public void init(){
|
|
|
+ this.rateLimiter = RateLimiter.create(RATE_LIMIT_NUM);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
|
|
|
public void onCourseWatchingBatch(List<FsCourseWatchLog> logs) {
|