parcelvoy / platform

Parcelvoy: Open source multi-channel marketing automation platform. Send data-driven emails, sms, push notifications and more!
https://parcelvoy.com
MIT License
261 stars 47 forks source link

Fixes list count drifting over time #525

Closed pushchris closed 1 month ago

pushchris commented 1 month ago

Currently the list count has a fundamental flaw in that its not decrementing the total whenever a user is removed from a list so over time it just continues to drift upward.

This completely removes partial counting from the list totals equation and instead relies on redis key incrementing and decrementing to keep track of totals and then periodically pulls those values into the database. This removes the counting load almost completely from the database.

It also fixes re-counting when updating a ruleset for a list.

This does temporarily reset the count of every list to zero so that they can be recalculated accurate to start the new incrementing system.