-
Notifications
You must be signed in to change notification settings - Fork 472
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
Refactor TTL processing in string type #2250
Conversation
Quality Gate passedIssues Measures |
@@ -107,8 +103,7 @@ class CommandGetEx : public Commander { | |||
} | |||
|
|||
private: | |||
uint64_t ttl_ = 0; | |||
bool persist_ = false; | |||
std::optional<uint64_t> expire_; |
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.
Would we have a class wrapper to distinguish the syntax?
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.
Is it necessary?
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 think a interface with something like has_ttl()
would look better, but feel free to just merge this
Previously, we use TTL as a parameter in string operations, and it's not good since we should use an absolute value in internal implementations to avoid double casting (
EXAT timestamp
-> cast to TTL -> cast back to expire timestamp, these introduce twoGetTimestampMS()
with probably different result).Here we change TTL to timestamp as the parameter of string operations.
Close #2248.