-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Batch update #285
Batch update #285
Conversation
9d2183b
to
6d4622b
Compare
7e0e86b
to
0ef11c6
Compare
you should rebase your branch to get some fixes in redis_cached |
0ef11c6
to
1afbaf8
Compare
c3a0757
to
b7e4d87
Compare
b7e4d87
to
d1c7092
Compare
d1c7092
to
cbc28c4
Compare
@@ -231,6 +233,30 @@ impl AsyncRedisStorage { | |||
|
|||
Ok(()) | |||
} | |||
|
|||
pub async fn update_counters( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fn could be named differently, a more explicit name would be batch_update_counters
... will leave it to the review
7d64901
to
7581f14
Compare
af29551
to
6d9cb5f
Compare
6d9cb5f
to
55bb83e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me… other that rename of cached_counters
into cacher
that I don't understand (like I don't understand the binding's name… literally).
Now, I also think the changes to keys.rs
of removing the namespace: &str
from the method signature are… unfortunate. As fundamentally I think we shouldn't resend the keys back, as we could "just" send the value & ttl for each ordered as we passed them in. This would avoid that change, but mostly would save bandwidth… We can iterate over these changes tho. Again, in the vein of avoiding doing work we can avoid doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these changes look good to me, tested it out with the driver and can see the writes in redis
than the updated count
fb7c9d4
to
1edd4c4
Compare
This PR replaces the way Limitador, configured to use Redis Cached storage, updates (flushes the in memory cache) to Redis. Instead of updating counters one by one, Limitador sends the batch of counters to update to Redis.
TODO
Limit batch update counters to redis (?)for the near futureNotes
EC Frankfurt – Limitador Sao Paulo