Skip to content
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

flushdb and flushall after clear #314

Open
Martenz opened this issue Oct 3, 2023 · 1 comment
Open

flushdb and flushall after clear #314

Martenz opened this issue Oct 3, 2023 · 1 comment

Comments

@Martenz
Copy link

Martenz commented Oct 3, 2023

Would it be possible to flush also the db and or all when clearing a specific namespace or the entire cache?
It seems keys are removed but space is still used in redis db after calling the clear method.

Thanks.

@Martenz
Copy link
Author

Martenz commented Oct 3, 2023

I made this temporary extent of the backend class to have it done. I guess it can be included in the backend methods. Not sure this is the best way to do it.

class RedisBackendFlush(RedisBackend):
    def __init__(self, redis: Union["Redis[bytes]", "RedisCluster[bytes]"]):
        super().__init__(redis)

    async def flushall(self):
        return await self.redis.flushall()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant