Skip to content

Commit 3a9714a

Browse files
feat:add RTC command (OpenAtomFoundation#3153)
Removed unused intercepted_list_cmds set from pika_client_conn.cc. --------- Co-authored-by: chejinge <[email protected]>
1 parent 6549083 commit 3a9714a

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/pika_client_conn.cc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,22 @@ void PikaClientConn::ProcessMonitor(const PikaCmdArgsType& argv) {
273273
}
274274

275275
bool PikaClientConn::IsInterceptedByRTC(std::string& opt) {
276-
// currently we only Intercept: Get, HGet
277-
if (opt == kCmdNameGet && g_pika_conf->GetCacheString()) {
276+
277+
static const std::unordered_set<std::string> intercepted_string_cmds = {
278+
kCmdNameGet, kCmdNameStrlen, kCmdNameTtl
279+
};
280+
281+
static const std::unordered_set<std::string> intercepted_hash_cmds = {
282+
kCmdNameHGet, kCmdNameHMget, kCmdNameHExists, kCmdNameHVals, kCmdNameHStrlen
283+
};
284+
285+
if (intercepted_string_cmds.count(opt) && g_pika_conf->GetCacheString()) {
278286
return true;
279287
}
280-
if (opt == kCmdNameHGet && g_pika_conf->GetCacheHash()) {
288+
if (intercepted_hash_cmds.count(opt) && g_pika_conf->GetCacheHash()) {
281289
return true;
282290
}
291+
283292
return false;
284293
}
285294

0 commit comments

Comments
 (0)