Pārlūkot izejas kodu

feat:redis store optimize

zhaohaipeng 4 nedēļas atpakaļ
vecāks
revīzija
31ff77c924

+ 8 - 8
recommend-feature-produce/src/main/java/com/tzld/piaoquan/recommend/feature/produce/service/RedisService.java

@@ -95,14 +95,14 @@ public class RedisService implements Serializable {
                 pipeline.setex(key.getBytes(StandardCharsets.UTF_8), expireSeconds, CompressionUtil.snappyCompressV2(e.getValue()));
             } catch (Exception ignore) {
             }
-        }
-        try {
-            byte[][] deleteKeyArr = batch.keySet().stream()
-                    .map(s -> String.format("%s:v2", s))
-                    .map(s -> s.getBytes(StandardCharsets.UTF_8))
-                    .toArray(byte[][]::new);
-            jedis.del(deleteKeyArr);
-        } catch (Exception ignore) {
+
+            try {
+                String deleteKey = String.format("%s:v2", e.getKey());
+                pipeline.del(deleteKey.getBytes(StandardCharsets.UTF_8));
+            }catch (Exception ignore){
+
+            }
+
         }
 
         pipeline.sync();