Skip to content

Commit

Permalink
fix: RedisEnchanceKeyValueAdapter#put make DEL/HMSET combo in a pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
bsbodden committed Aug 6, 2024
1 parent f3fbd0c commit 5396979
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,9 @@ public Object put(Object id, Object item, String keyspace) {
rdo.setId(converter.getConversionService().convert(id, String.class));
}

byte[] objectKey = createKey(sanitizeKeyspace(rdo.getKeyspace()), rdo.getId());
redisOperations.execute((RedisCallback<Boolean>) connection -> connection.keyCommands().del(objectKey) == 0);

redisOperations.executePipelined((RedisCallback<Object>) connection -> {
byte[] objectKey = createKey(sanitizeKeyspace(rdo.getKeyspace()), rdo.getId());
connection.keyCommands().del(objectKey);
Map<byte[], byte[]> rawMap = rdo.getBucket().rawMap();
connection.hashCommands().hMSet(objectKey, rawMap);

Expand Down

0 comments on commit 5396979

Please sign in to comment.