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

Implement SET with KEEPTTL #277

Merged
merged 3 commits into from
Aug 14, 2020
Merged

Implement SET with KEEPTTL #277

merged 3 commits into from
Aug 14, 2020

Conversation

mgetka
Copy link
Contributor

@mgetka mgetka commented Aug 14, 2020

Add support to KEEPTTL flag in the SET command which become available in redis-py 3.5.0.

@coveralls
Copy link

coveralls commented Aug 14, 2020

Coverage Status

Coverage increased (+0.1%) to 96.116% when pulling 236fd27 on mgetka:master into 5d0ae2b on jamesls:master.

else:
raise SimpleError(SYNTAX_ERROR_MSG)
if (xx and nx) or (px is not None and ex is not None):
if (xx and nx) or ((px is not None) + (ex is not None) + keepttl > 1):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

SET command documentation suggests that KEEPTTL option can be set next to PX or EX options, but in reality redis denies such requests. This behavior seems reasonable so I believe this is an error in the documentation and thus I enforce the actual (not the documented) behavior on the case of conflicting expiration options.

@bmerry
Copy link
Collaborator

bmerry commented Aug 14, 2020

Thanks, good work!

@bmerry bmerry merged commit 9efdecd into jamesls:master Aug 14, 2020
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.

3 participants