File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -887,7 +887,7 @@ std::string SetexCmd::ToRedisProtocol() {
887887 RedisAppendContent (content, key_);
888888 // time_stamp
889889 char buf[100 ];
890- auto time_stamp = time (nullptr ) + ttl_sec_;
890+ int64_t time_stamp = static_cast < int64_t >(:: time (nullptr ) ) + ttl_sec_;
891891 pstd::ll2string (buf, 100 , time_stamp);
892892 std::string at (buf);
893893 RedisAppendLenUint64 (content, at.size (), " $" );
@@ -945,8 +945,9 @@ std::string PsetexCmd::ToRedisProtocol() {
945945 RedisAppendLenUint64 (content, key_.size (), " $" );
946946 RedisAppendContent (content, key_);
947947 // time_stamp
948+ int64_t expire_at_ms = pstd::NowMillis () + ttl_millsec;
949+ int64_t time_stamp = expire_at_ms / 1000 ;
948950 char buf[100 ];
949- auto time_stamp = pstd::NowMillis () + ttl_millsec;
950951 pstd::ll2string (buf, 100 , time_stamp);
951952 std::string at (buf);
952953 RedisAppendLenUint64 (content, at.size (), " $" );
You can’t perform that action at this time.
0 commit comments