Skip to content

Commit

Permalink
Merge branch 'unstable' into exec-check
Browse files Browse the repository at this point in the history
  • Loading branch information
PragmaTwice authored Nov 16, 2024
2 parents 6ab1509 + cc4f63d commit a97666b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ testdb

build
cmake-build-*
build-*
7 changes: 3 additions & 4 deletions src/commands/cmd_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -894,10 +894,9 @@ class CommandLPos : public Commander {
PosSpec spec_;
};

REDIS_REGISTER_COMMANDS(List, MakeCmdAttr<CommandBLPop>("blpop", -3, "write no-script blocking", 1, -2, 1),
MakeCmdAttr<CommandBRPop>("brpop", -3, "write no-script blocking", 1, -2, 1),
MakeCmdAttr<CommandBLMPop>("blmpop", -5, "write no-script blocking",
CommandBLMPop::keyRangeGen),
REDIS_REGISTER_COMMANDS(List, MakeCmdAttr<CommandBLPop>("blpop", -3, "write blocking", 1, -2, 1),
MakeCmdAttr<CommandBRPop>("brpop", -3, "write blocking", 1, -2, 1),
MakeCmdAttr<CommandBLMPop>("blmpop", -5, "write blocking", CommandBLMPop::keyRangeGen),
MakeCmdAttr<CommandLIndex>("lindex", 3, "read-only", 1, 1, 1),
MakeCmdAttr<CommandLInsert>("linsert", 5, "write slow", 1, 1, 1),
MakeCmdAttr<CommandLLen>("llen", 2, "read-only", 1, 1, 1),
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 @@ -1343,7 +1343,7 @@ REDIS_REGISTER_COMMANDS(Server, MakeCmdAttr<CommandAuth>("auth", 2, "read-only o
MakeCmdAttr<CommandSlowlog>("slowlog", -2, "read-only", NO_KEY),
MakeCmdAttr<CommandPerfLog>("perflog", -2, "read-only", NO_KEY),
MakeCmdAttr<CommandClient>("client", -2, "read-only", NO_KEY),
MakeCmdAttr<CommandMonitor>("monitor", 1, "read-only no-multi", NO_KEY),
MakeCmdAttr<CommandMonitor>("monitor", 1, "read-only no-multi no-script", NO_KEY),
MakeCmdAttr<CommandShutdown>("shutdown", 1, "read-only no-multi no-script", NO_KEY),
MakeCmdAttr<CommandQuit>("quit", 1, "read-only", NO_KEY),
MakeCmdAttr<CommandScan>("scan", -2, "read-only", NO_KEY),
Expand Down
8 changes: 6 additions & 2 deletions src/commands/commander.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,13 @@ inline uint64_t ParseCommandFlags(const std::string &description, const std::str
flags |= kCmdNoDBSizeCheck;
else if (flag == "slow")
flags |= kCmdSlow;
else if (flag == "blocking")
else if (flag == "blocking") {
flags |= kCmdBlocking;
else {

// blocking commands should always be no-script
// TODO: we can relax this restriction if scripting becomes non-exclusive
flags |= kCmdNoScript;
} else {
std::cout << fmt::format("Encountered non-existent flag '{}' in command {} in command attribute parsing", flag,
cmd_name)
<< std::endl;
Expand Down

0 comments on commit a97666b

Please sign in to comment.