praekelt / vumi-message-store

A persistent store for vumi messages.
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Smarter batch info cache rebuilding #6

Closed jerith closed 9 years ago

jerith commented 9 years ago

We currently update the batch info cache for every message instead of doing a bulk update.

JayH5 commented 9 years ago

Ready for review.

This is probably the simplest step in getting smarter about rebuilding the cache. I haven't tried some more complicated things like building a set of from/to addresses before sending them off to Redis (the address for each message is added one-by-one).

jerith commented 9 years ago

We need more of a split between the handling of "old" and "new" messages. We should handle "new" messages exactly as if they were non-rebuild messages, and then move on. For "old" messages, on the other hand, we should update the relevant HLLs and increment our in-memory counters.

JayH5 commented 9 years ago

Next attempt ready for review... the code is a little complicated now... will take suggestions for refactoring..

JayH5 commented 9 years ago

Third time lucky? One weird thing is that before I changed the add_from_addr and add_to_addr methods to accept *to_addrs and *from_addrs all the tests still passed :confused:

JayH5 commented 9 years ago

Now with more tests :smile:

jerith commented 9 years ago

:+1: