Skip to content

Commit 1f17f8e

Browse files
committed
fix SETEX replication does not work
1 parent 1513cf9 commit 1f17f8e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/pika_kv.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,9 @@ void PKSetexAtCmd::DoInitial() {
17711771
}
17721772

17731773
void PKSetexAtCmd::Do() {
1774-
s_ = db_->storage()->PKSetexAt(key_, value_, static_cast<int32_t>(time_stamp_sec_ * 1000));
1774+
// Use int64_t to avoid overflow
1775+
int64_t time_stamp_ms = static_cast<int64_t>(time_stamp_sec_) * 1000;
1776+
s_ = db_->storage()->PKSetexAt(key_, value_, time_stamp_ms);
17751777
if (s_.ok()) {
17761778
res_.SetRes(CmdRes::kOk);
17771779
} else if (s_.IsInvalidArgument()) {

0 commit comments

Comments
 (0)