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

Iss 68 implement GETDEL command #97

Merged
merged 3 commits into from
Aug 25, 2024
Merged

Conversation

osteensco
Copy link
Contributor

addresses #68

adds getdel command
adds GetDel method to generic api

Redis GETDEL says it will delete the key only if it is a string... I was unsure of the reasoning behind this, so currently my implementation deletes the key after returning its value regardless of data type (assuming the key exists). I can see use cases for wanting a more atomic "delete after get" option for keys that aren't necessarily string values. Happy to update my PR if needed.

Also added a break to the loop in randomKey method so that every call would not iterate over the entire map every time which would lead to not so random results. 🙃

@osteensco
Copy link
Contributor Author

@kelvinmwinuka I have not been able to reproduce this failure locally, but from what I can tell it's not related to GETDEL. 🤷‍♂️

Copy link
Collaborator

@kelvinmwinuka kelvinmwinuka left a comment

Choose a reason for hiding this comment

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

LGTM

@kelvinmwinuka kelvinmwinuka merged commit ac09649 into EchoVault:main Aug 25, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants