wangyunpeng пре 1 дан
родитељ
комит
2c6e895ee5

+ 4 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/filter/FilterService.java

@@ -51,10 +51,10 @@ public class FilterService {
         List<FilterStrategy> strategies = getAllStrategies(param);
         String dateStr = DateUtils.getCurrentDateStr("yyyyMMdd");
         String redisKey = RedisConstants.buildContentPreFilterJobKey(dateStr, param.getPlanId(), param.getAccountId());
+        String value = redisTemplate.opsForValue().get(redisKey);
 
         // 已同步待发布内容 预过滤
         if (!preFilter) {
-            String value = redisTemplate.opsForValue().get(redisKey);
             if (StringUtils.hasText(value)) {
                 strategies = getUnPreFilterStrategies(param);
             }
@@ -128,6 +128,9 @@ public class FilterService {
         } else {
             redisTemplate.opsForValue().set(redisKey, "1", 1, TimeUnit.DAYS);
         }
+        if (!preFilter && !StringUtils.hasText(value) && CollectionUtils.isEmpty(filterContents)) {
+            redisTemplate.opsForValue().set(redisKey, "1", 1, TimeUnit.DAYS);
+        }
         return result;
     }