We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f91cae commit 26d10e6Copy full SHA for 26d10e6
src/pika_kv.cc
@@ -111,7 +111,7 @@ void SetCmd::DoUpdateCache() {
111
}
112
if (s_.ok()) {
113
if (has_ttl_) {
114
- db_->cache()->Setxx(key_, value_, ttl_millsec / 1000);
+ db_->cache()->Setxx(key_, value_, ttl_millsec > 0 ? ttl_millsec / 1000 : ttl_millsec);
115
} else {
116
db_->cache()->SetxxWithoutTTL(key_, value_);
117
@@ -191,7 +191,7 @@ void GetCmd::DoUpdateCache() {
191
return;
192
193
194
- db_->cache()->WriteKVToCache(key_, value_, ttl_millsec_ / 1000);
+ db_->cache()->WriteKVToCache(key_, value_, ttl_millsec_ > 0 ? ttl_millsec_ / 1000 : ttl_millsec_);
195
196
197
0 commit comments