CityofEdmonton/IFTTT-Edmonton

Max Redis list size is off by one

Closed this issue · 3 comments

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.

@j-rewerts Not sure if this might be the problem but I came across this environment variable:

process.env['MAX_RESULTS'] = 5

Yeah that's the one. Track that to our Redis access layer. I must have an off by one error there.

await this.client.ltrim(key, 0, this.maxElements)
This line in change writer.

It must be inclusive and I thought it was exclusive.