RedissonList.addAll connection should be closed

pull/6/head
Nikita
parent 6dfa671c15
commit 89142b71bc

@ -85,10 +85,10 @@ public class RedissonList<V> implements List<V> {
@Override
public boolean addAll(int index, Collection<? extends V> coll) {
checkPosition(index);
while (true) {
if (index < size()) {
RedisConnection<Object, Object> c = redisson.connect();
try {
while (true) {
c.watch(name);
List<Object> tail = c.lrange(name, index, size());
@ -99,11 +99,14 @@ public class RedissonList<V> implements List<V> {
if (c.exec().size() == 3) {
return true;
}
}
} finally {
c.close();
}
} else {
return addAll(coll);
}
}
}
@Override
public boolean removeAll(Collection<?> c) {

Loading…
Cancel
Save