git-hulk commented on code in PR #1684:
URL: https://github.com/apache/kvrocks/pull/1684#discussion_r1306622057


##########
src/commands/cmd_server.cc:
##########
@@ -978,6 +980,70 @@ static uint64_t GenerateConfigFlag(const 
std::vector<std::string> &args) {
   return 0;
 }
 
+class CommandRestore : public Commander {
+ public:
+  Status Parse(const std::vector<std::string> &args) override {
+    CommandParser parser(args, 4);
+    ttl_ms_ = GET_OR_RET(ParseInt<uint64_t>(args[2], 10));
+    while (parser.Good()) {
+      if (parser.EatEqICase("replace")) {
+        replace_ = true;
+      } else if (parser.EatEqICase("absttl")) {
+        auto now = util::GetTimeStampMS();
+        if (ttl_ms_ <= static_cast<uint64_t>(now)) {
+          return {Status::RedisExecErr, "Invalid expire time"};
+        }
+        ttl_ms_ -= now;

Review Comment:
   Good catch, will fix it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to