Skip to content

Commit 4a4566b

Browse files
aciddustdvora-h
andauthored
Fix xadd allow non negative maxlen (#2739)
* Fix xadd allow non negative maxlen * Update change log --------- Co-authored-by: dvora-h <[email protected]>
1 parent 984b733 commit 4a4566b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGES

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Fix `xadd` command to accept non-negative `maxlen` including 0
12
* Revert #2104, #2673, add `disconnect_on_error` option to `read_response()` (issues #2506, #2624)
23
* Add `address_remap` parameter to `RedisCluster`
34
* Fix incorrect usage of once flag in async Sentinel

redis/commands/core.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3496,8 +3496,8 @@ def xadd(
34963496
raise DataError("Only one of ```maxlen``` or ```minid``` may be specified")
34973497

34983498
if maxlen is not None:
3499-
if not isinstance(maxlen, int) or maxlen < 1:
3500-
raise DataError("XADD maxlen must be a positive integer")
3499+
if not isinstance(maxlen, int) or maxlen < 0:
3500+
raise DataError("XADD maxlen must be non-negative integer")
35013501
pieces.append(b"MAXLEN")
35023502
if approximate:
35033503
pieces.append(b"~")

0 commit comments

Comments
 (0)