Skip to content

Commit

Permalink
feat(command): add slow flag to more commands (#2570)
Browse files Browse the repository at this point in the history
  • Loading branch information
PragmaTwice authored Oct 3, 2024
1 parent 1266227 commit e3211c1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/commands/cmd_hash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,6 @@ REDIS_REGISTER_COMMANDS(Hash, MakeCmdAttr<CommandHGet>("hget", 3, "read-only", 1
MakeCmdAttr<CommandHGetAll>("hgetall", 2, "read-only slow", 1, 1, 1),
MakeCmdAttr<CommandHScan>("hscan", -3, "read-only", 1, 1, 1),
MakeCmdAttr<CommandHRangeByLex>("hrangebylex", -4, "read-only", 1, 1, 1),
MakeCmdAttr<CommandHRandField>("hrandfield", -2, "read-only", 1, 1, 1), )
MakeCmdAttr<CommandHRandField>("hrandfield", -2, "read-only slow", 1, 1, 1), )

} // namespace redis
4 changes: 2 additions & 2 deletions src/commands/cmd_key.cc
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ REDIS_REGISTER_COMMANDS(Key, MakeCmdAttr<CommandTTL>("ttl", 2, "read-only", 1, 1
MakeCmdAttr<CommandRename>("rename", 3, "write", 1, 2, 1),
MakeCmdAttr<CommandRenameNX>("renamenx", 3, "write", 1, 2, 1),
MakeCmdAttr<CommandCopy>("copy", -3, "write", 1, 2, 1),
MakeCmdAttr<CommandSort<false>>("sort", -2, "write", 1, 1, 1),
MakeCmdAttr<CommandSort<true>>("sort_ro", -2, "read-only", 1, 1, 1))
MakeCmdAttr<CommandSort<false>>("sort", -2, "write slow", 1, 1, 1),
MakeCmdAttr<CommandSort<true>>("sort_ro", -2, "read-only slow", 1, 1, 1))

} // namespace redis
3 changes: 2 additions & 1 deletion src/commands/cmd_search.cc
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,8 @@ class CommandFTDrop : public Commander {
};

REDIS_REGISTER_COMMANDS(Search,
MakeCmdAttr<CommandFTCreate>("ft.create", -2, "write exclusive no-multi no-script", 0, 0, 0),
MakeCmdAttr<CommandFTCreate>("ft.create", -2, "write exclusive no-multi no-script slow", 0, 0,
0),
MakeCmdAttr<CommandFTSearchSQL>("ft.searchsql", -2, "read-only", 0, 0, 0),
MakeCmdAttr<CommandFTSearch>("ft.search", -3, "read-only", 0, 0, 0),
MakeCmdAttr<CommandFTExplainSQL>("ft.explainsql", -2, "read-only", 0, 0, 0),
Expand Down
2 changes: 1 addition & 1 deletion src/commands/cmd_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ REDIS_REGISTER_COMMANDS(Server, MakeCmdAttr<CommandAuth>("auth", 2, "read-only o
MakeCmdAttr<CommandRole>("role", 1, "read-only ok-loading", 0, 0, 0),
MakeCmdAttr<CommandConfig>("config", -2, "read-only", 0, 0, 0, GenerateConfigFlag),
MakeCmdAttr<CommandNamespace>("namespace", -3, "read-only", 0, 0, 0),
MakeCmdAttr<CommandKeys>("keys", 2, "read-only", 0, 0, 0),
MakeCmdAttr<CommandKeys>("keys", 2, "read-only slow", 0, 0, 0),
MakeCmdAttr<CommandFlushDB>("flushdb", 1, "write no-dbsize-check", 0, 0, 0),
MakeCmdAttr<CommandFlushAll>("flushall", 1, "write no-dbsize-check", 0, 0, 0),
MakeCmdAttr<CommandDBSize>("dbsize", -1, "read-only", 0, 0, 0),
Expand Down
2 changes: 1 addition & 1 deletion src/commands/cmd_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ REDIS_REGISTER_COMMANDS(Set, MakeCmdAttr<CommandSAdd>("sadd", -3, "write", 1, 1,
MakeCmdAttr<CommandSIsMember>("sismember", 3, "read-only", 1, 1, 1),
MakeCmdAttr<CommandSMIsMember>("smismember", -3, "read-only", 1, 1, 1),
MakeCmdAttr<CommandSPop>("spop", -2, "write", 1, 1, 1),
MakeCmdAttr<CommandSRandMember>("srandmember", -2, "read-only", 1, 1, 1),
MakeCmdAttr<CommandSRandMember>("srandmember", -2, "read-only slow", 1, 1, 1),
MakeCmdAttr<CommandSMove>("smove", 4, "write", 1, 2, 1),
MakeCmdAttr<CommandSDiff>("sdiff", -2, "read-only slow", 1, -1, 1),
MakeCmdAttr<CommandSUnion>("sunion", -2, "read-only slow", 1, -1, 1),
Expand Down
2 changes: 1 addition & 1 deletion src/commands/cmd_txn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class CommandUnwatch : public Commander {

REDIS_REGISTER_COMMANDS(Txn, MakeCmdAttr<CommandMulti>("multi", 1, "multi", 0, 0, 0),
MakeCmdAttr<CommandDiscard>("discard", 1, "multi", 0, 0, 0),
MakeCmdAttr<CommandExec>("exec", 1, "exclusive multi", 0, 0, 0),
MakeCmdAttr<CommandExec>("exec", 1, "exclusive multi slow", 0, 0, 0),
MakeCmdAttr<CommandWatch>("watch", -2, "multi", 1, -1, 1),
MakeCmdAttr<CommandUnwatch>("unwatch", 1, "multi", 0, 0, 0), )

Expand Down

0 comments on commit e3211c1

Please sign in to comment.