diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2018-12-27 23:40:58 -0800 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2018-12-27 23:40:58 -0800 |
commit | 977e739e386b4085086c14d2cde4007761f36566 (patch) | |
tree | 2517a30bc619e7fb3acea0541529da41fb9b75b5 | |
parent | 985282417b2e4d66c3376dd7e1ea9b38d452ed37 (diff) | |
download | redis-py-977e739e386b4085086c14d2cde4007761f36566.tar.gz |
XPENDING range queries no longer allow COUNT to be infinite
Redis 5.0.1 and beyond require that COUNT be specified as a positive
integer. Since we can't guess the maximum possible value (UULONG_MAX
can vary based on server architecture), force min/max/count to be
required arguments
-rwxr-xr-x | redis/client.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/redis/client.py b/redis/client.py index c0d738c..60270ae 100755 --- a/redis/client.py +++ b/redis/client.py @@ -2123,18 +2123,15 @@ class Redis(object): """ return self.execute_command('XPENDING', name, groupname) - def xpending_range(self, name, groupname, min='-', max='+', count=-1, + def xpending_range(self, name, groupname, min, max, count, consumername=None): """ Returns information about pending messages, in a range. name: name of the stream. groupname: name of the consumer group. - start: first stream ID. defaults to '-', - meaning the earliest available. - finish: last stream ID. defaults to '+', - meaning the latest available. - count: if set, only return this many items, beginning with the - earliest available. + min: minimum stream ID. + max: maximum stream ID. + count: number of messages to return consumername: name of a consumer to filter by (optional). """ pieces = [name, groupname] |