Browse Source

feat:热点宝召回修改

zhaohaipeng 1 week ago
parent
commit
40d35b7265

+ 7 - 4
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/flowpool/FlowPoolService.java

@@ -171,10 +171,13 @@ public class FlowPoolService {
                 return;
             }
 
-            // 从流量池缓存中移除达到分发次数限制的视频ID
-            String itemKey = String.format(RedisKeyConstants.DouHot.ITEM_REDIS_KEY_FORMAT, province, "1");
-            log.info("[DouHot view distribute count remove cache] key: {}, item: {}", itemKey, needRemoveVideoIds);
-            redisTemplate.opsForZSet().remove(itemKey, needRemoveVideoIds.toArray());
+            Map<String, Double> douHotLevelWeight = flowPoolConfigService.getDouHotFLowPoolWithLevel();
+            for (Map.Entry<String, Double> entry : douHotLevelWeight.entrySet()) {
+                // 从流量池缓存中移除达到分发次数限制的视频ID
+                String itemKey = String.format(RedisKeyConstants.DouHot.ITEM_REDIS_KEY_FORMAT, province, entry.getKey());
+                log.info("[DouHot view distribute count remove cache] key: {}, item: {}", itemKey, needRemoveVideoIds);
+                redisTemplate.opsForZSet().remove(itemKey, needRemoveVideoIds.toArray());
+            }
         });
     }