丁云鹏 1 year ago
parent
commit
d2aea7b048

+ 4 - 1
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/WarmUpService.java

@@ -1,5 +1,6 @@
 package com.tzld.piaoquan.recommend.server.service;
 
+import com.tzld.piaoquan.recommend.server.repository.WxVideoStatusRepository;
 import com.tzld.piaoquan.recommend.server.service.score.ScorerUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -24,7 +25,8 @@ public class WarmUpService {
     @Autowired
     @Qualifier("longVideoRedisTemplate")
     private RedisTemplate<String, String> longVideoRedisTemplate;
-
+    @Autowired
+    private WxVideoStatusRepository wxVideoStatusRepository;
 
     @PostConstruct
     public void warmup() {
@@ -32,5 +34,6 @@ public class WarmUpService {
         featureRedisTemplate.opsForValue().get("");
         longVideoRedisTemplate.opsForValue().get("");
         ScorerUtils.warmUp();
+        wxVideoStatusRepository.count();
     }
 }

+ 2 - 0
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/filter/strategy/RecommendStatusStrategy.java

@@ -11,6 +11,7 @@ import org.apache.commons.lang3.RandomUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.math.NumberUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.dao.DataAccessException;
 import org.springframework.data.redis.core.RedisOperations;
 import org.springframework.data.redis.core.RedisTemplate;
@@ -29,6 +30,7 @@ import java.util.stream.Collectors;
 @Slf4j
 public class RecommendStatusStrategy implements FilterStrategy {
     @Autowired
+    @Qualifier("redisTemplate")
     private RedisTemplate<String, String> redisTemplate;
 
     @Autowired