RedisTbTransactionalCache fix - skip eviction of empty key list
This commit is contained in:
parent
47ed9e0541
commit
fd7f53bc95
@ -108,6 +108,10 @@ public abstract class RedisTbTransactionalCache<K extends Serializable, V extend
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void evict(Collection<K> keys) {
|
public void evict(Collection<K> keys) {
|
||||||
|
//Redis expects at least 1 key to delete. Otherwise - ERR wrong number of arguments for 'del' command
|
||||||
|
if (keys.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
try (var connection = connectionFactory.getConnection()) {
|
try (var connection = connectionFactory.getConnection()) {
|
||||||
connection.del(keys.stream().map(this::getRawKey).toArray(byte[][]::new));
|
connection.del(keys.stream().map(this::getRawKey).toArray(byte[][]::new));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user