From 4a4566b59a07289ebe6e18bf351ad666fa419a00 Mon Sep 17 00:00:00 2001 From: Seongchuel Ahn Date: Mon, 8 May 2023 20:16:26 +0900 Subject: Fix `xadd` allow non negative maxlen (#2739) * Fix xadd allow non negative maxlen * Update change log --------- Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> --- redis/commands/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'redis/commands/core.py') diff --git a/redis/commands/core.py b/redis/commands/core.py index 1a4acb2..f2d7bf2 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -3496,8 +3496,8 @@ class StreamCommands(CommandsProtocol): raise DataError("Only one of ```maxlen``` or ```minid``` may be specified") if maxlen is not None: - if not isinstance(maxlen, int) or maxlen < 1: - raise DataError("XADD maxlen must be a positive integer") + if not isinstance(maxlen, int) or maxlen < 0: + raise DataError("XADD maxlen must be non-negative integer") pieces.append(b"MAXLEN") if approximate: pieces.append(b"~") -- cgit v1.2.1