mirror of
https://github.com/fluencelabs/redis
synced 2025-05-17 04:51:19 +00:00
Streams: reset approx_maxlen in every maxlen loop
This commit is contained in:
parent
affd93654f
commit
f04d799bb9
@ -1140,6 +1140,7 @@ void xaddCommand(client *c) {
|
|||||||
* creation. */
|
* creation. */
|
||||||
break;
|
break;
|
||||||
} else if (!strcasecmp(opt,"maxlen") && moreargs) {
|
} else if (!strcasecmp(opt,"maxlen") && moreargs) {
|
||||||
|
approx_maxlen = 0;
|
||||||
char *next = c->argv[i+1]->ptr;
|
char *next = c->argv[i+1]->ptr;
|
||||||
/* Check for the form MAXLEN ~ <count>. */
|
/* Check for the form MAXLEN ~ <count>. */
|
||||||
if (moreargs >= 2 && next[0] == '~' && next[1] == '\0') {
|
if (moreargs >= 2 && next[0] == '~' && next[1] == '\0') {
|
||||||
@ -2207,6 +2208,7 @@ void xtrimCommand(client *c) {
|
|||||||
int moreargs = (c->argc-1) - i; /* Number of additional arguments. */
|
int moreargs = (c->argc-1) - i; /* Number of additional arguments. */
|
||||||
char *opt = c->argv[i]->ptr;
|
char *opt = c->argv[i]->ptr;
|
||||||
if (!strcasecmp(opt,"maxlen") && moreargs) {
|
if (!strcasecmp(opt,"maxlen") && moreargs) {
|
||||||
|
approx_maxlen = 0;
|
||||||
trim_strategy = TRIM_STRATEGY_MAXLEN;
|
trim_strategy = TRIM_STRATEGY_MAXLEN;
|
||||||
char *next = c->argv[i+1]->ptr;
|
char *next = c->argv[i+1]->ptr;
|
||||||
/* Check for the form MAXLEN ~ <count>. */
|
/* Check for the form MAXLEN ~ <count>. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user