From 977e739e386b4085086c14d2cde4007761f36566 Mon Sep 17 00:00:00 2001 From: Andy McCurdy Date: Thu, 27 Dec 2018 23:40:58 -0800 Subject: 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 --- redis/client.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'redis/client.py') 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] -- cgit v1.2.1