|
@@ -87,16 +87,16 @@ public class RedisService implements Serializable {
|
|
|
for (Map.Entry<String, String> e : batch.entrySet()) {
|
|
for (Map.Entry<String, String> e : batch.entrySet()) {
|
|
|
// pipeline.setex(e.getKey(), expireSeconds, e.getValue());
|
|
// pipeline.setex(e.getKey(), expireSeconds, e.getValue());
|
|
|
// 压缩后的key,升级后进行替换
|
|
// 压缩后的key,升级后进行替换
|
|
|
- // try {
|
|
|
|
|
- // pipeline.setex(e.getKey(), expireSeconds, CompressionUtil.snappyCompress(e.getValue()));
|
|
|
|
|
- // } catch (Exception ex) {
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
try {
|
|
try {
|
|
|
- String newKey = String.format("%s:v2", e.getKey());
|
|
|
|
|
- pipeline.setex(newKey.getBytes(StandardCharsets.UTF_8), expireSeconds, CompressionUtil.snappyCompressV2(e.getValue()));
|
|
|
|
|
- } catch (Exception ignore) {
|
|
|
|
|
|
|
+ pipeline.setex(e.getKey(), 10, CompressionUtil.snappyCompress(e.getValue()));
|
|
|
|
|
+ } catch (Exception ex) {
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // try {
|
|
|
|
|
+ // String newKey = String.format("%s:v2", e.getKey());
|
|
|
|
|
+ // pipeline.setex(newKey.getBytes(StandardCharsets.UTF_8), expireSeconds, CompressionUtil.snappyCompressV2(e.getValue()));
|
|
|
|
|
+ // } catch (Exception ignore) {
|
|
|
|
|
+ // }
|
|
|
}
|
|
}
|
|
|
pipeline.sync();
|
|
pipeline.sync();
|
|
|
|
|
|