-
Notifications
You must be signed in to change notification settings - Fork 107
Add cache_clear
operation
#200
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
base: master
Are you sure you want to change the base?
Conversation
src/stores/redis.rs
Outdated
// https://redis.io/commands/flushdb/ | ||
let _: () = redis::cmd("FLUSHDB").query(&mut *conn)?; |
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.
Wouldn't this delete someone's entire redis db? I think a scan
+ delete
would need to be done instead, using the self.namespace
+ self.prefix
in the scan
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.
Oh I just assumed the Redis DB was already unique per cache. I can fix this.
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.
Ty!
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 took a shot at it but needing two connections seems weird. scan_match
needs &mut self
, though, so I can't do anything with the deserialized values without opening another connection or collecting them all into memory first.
https://docs.rs/redis/latest/redis/trait.Commands.html#method.scan_match
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.
Any plans to merge this?
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.
Took a while, but I reimplemented this with the scan
+ delete
strategy. Should be ready now?
Hi all, is there any development regarding this feature? Was it possibly added in some other PR? I am looking for a way to clear the redis cache. |
228daae
to
6cdcd56
Compare
6cdcd56
to
7d2342b
Compare
@LucaCappelletti94 I just fixed up the merge conflicts and fixed up the async Redis |
Closes #197.