DATAREDIS-1234 - Consistently return List<Long> from LPOS command.

We now convert pipeline/transaction results to List<Long> to ensure a consistent return type.

Original Pull Request: #570
This commit is contained in:
Mark Paluch
2020-10-21 15:39:42 +02:00
committed by Christoph Strobl
parent 7f9de716c8
commit 8e4f796309
2 changed files with 6 additions and 4 deletions

View File

@@ -83,7 +83,8 @@ class LettuceListCommands implements RedisListCommands {
if (count != null) {
pipeline(connection.newLettuceResult(getAsyncConnection().lpos(key, element, count, args)));
} else {
pipeline(connection.newLettuceResult(getAsyncConnection().lpos(key, element, args)));
pipeline(
connection.newLettuceResult(getAsyncConnection().lpos(key, element, args), Collections::singletonList));
}
return null;
}
@@ -91,7 +92,8 @@ class LettuceListCommands implements RedisListCommands {
if (count != null) {
transaction(connection.newLettuceResult(getAsyncConnection().lpos(key, element, count, args)));
} else {
transaction(connection.newLettuceResult(getAsyncConnection().lpos(key, element, args)));
transaction(
connection.newLettuceResult(getAsyncConnection().lpos(key, element, args), Collections::singletonList));
}
return null;
}