diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2018-10-31 22:50:35 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2018-10-31 22:50:35 -0700 |
commit | ad6d36257692f5f3a5874ba1cc004ad57f145d0e (patch) | |
tree | ac25a8b6657ef7aec10ab3e2a050dd130424c559 | |
parent | eaf6b2d23ad3e9a46f141cc4fa0fa62240fadba9 (diff) | |
download | redis-py-ad6d36257692f5f3a5874ba1cc004ad57f145d0e.tar.gz |
explicit parsing of xclaim response with justid=True
-rwxr-xr-x | redis/client.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/redis/client.py b/redis/client.py index 2ab938a..45f1ff0 100755 --- a/redis/client.py +++ b/redis/client.py @@ -251,8 +251,8 @@ def parse_list_of_dicts(response): return list(imap(pairs_to_dict_with_nativestr_keys, response)) -def parse_xclaim(response): - if all(isinstance(r, (basestring, bytes)) for r in response): +def parse_xclaim(response, **options): + if options.get('parse_justid', False): return response return parse_stream_list(response) @@ -1810,6 +1810,7 @@ class StrictRedis(object): raise RedisError("XCLAIM message_ids must be a non empty list or " "tuple of message IDs to claim") + kwargs = {} pieces = [name, groupname, consumername, str(min_idle_time)] pieces.extend(list(message_ids)) @@ -1834,7 +1835,8 @@ class StrictRedis(object): if not isinstance(justid, bool): raise RedisError("XCLAIM justid must be a boolean") pieces.append(Token.get_token('JUSTID')) - return self.execute_command('XCLAIM', *pieces) + kwargs['parse_justid'] = True + return self.execute_command('XCLAIM', *pieces, **kwargs) def xdel(self, name, *ids): """ |