Max Redis list size is off by one
Closed this issue · 3 comments
j-rewerts commented
In production, we're currently saving a max of 5 of the most recent records. When you view the Redis keys that are active enough to fill that space, they actually have 6 records in the list.
WJXHenry commented
@j-rewerts Not sure if this might be the problem but I came across this environment variable:
Line 25 in 0f3fd5a
j-rewerts commented
Yeah that's the one. Track that to our Redis access layer. I must have an off by one error there.
j-rewerts commented
await this.client.ltrim(key, 0, this.maxElements)
This line in change writer.
It must be inclusive and I thought it was exclusive.