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

Add command to delete a single key #2

Merged
merged 2 commits into from
May 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions acapy_cache_redis/v0_1/redis_base_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ async def clear(self, key: Text):
key: the key to remove

"""
#TODO: clear redis cache given a key
pass
keysDeleted = await self.redis.delete(f"ACA-Py:{key}")
assert keysDeleted == 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the assertion. we can add error reporting too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assertion might not be true in the case that the key has expired.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assertion was eventually removed partially for that reason


async def flush(self):
"""Remove all items from the cache."""
Expand Down