Skip to content

Commit

Permalink
Unified the leading k in connection flags (#2260)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjz921024 committed Apr 20, 2024
1 parent bc1fc9f commit 1b18b79
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cluster/cluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ Status Cluster::CanExecByMySelf(const redis::CommandAttributes *attributes, cons

if (myself_ && myself_->role == kClusterSlave && !(attributes->flags & redis::kCmdWrite) &&
nodes_.find(myself_->master_id) != nodes_.end() && nodes_[myself_->master_id] == slots_nodes_[slot] &&
conn->IsFlagEnabled(redis::Connection::KReadOnly)) {
conn->IsFlagEnabled(redis::Connection::kReadOnly)) {
return Status::OK(); // My master is serving this slot
}

Expand Down
4 changes: 2 additions & 2 deletions src/commands/cmd_cluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class CommandReadOnly : public Commander {
public:
Status Execute(Server *srv, Connection *conn, std::string *output) override {
*output = redis::SimpleString("OK");
conn->EnableFlag(redis::Connection::KReadOnly);
conn->EnableFlag(redis::Connection::kReadOnly);
return Status::OK();
}
};
Expand All @@ -326,7 +326,7 @@ class CommandReadWrite : public Commander {
public:
Status Execute(Server *srv, Connection *conn, std::string *output) override {
*output = redis::SimpleString("OK");
conn->DisableFlag(redis::Connection::KReadOnly);
conn->DisableFlag(redis::Connection::kReadOnly);
return Status::OK();
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/server/redis_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Connection : public EvbufCallbackBase<Connection> {
kCloseAfterReply = 1 << 6,
kCloseAsync = 1 << 7,
kMultiExec = 1 << 8,
KReadOnly = 1 << 9,
kReadOnly = 1 << 9,
};

explicit Connection(bufferevent *bev, Worker *owner);
Expand Down

0 comments on commit 1b18b79

Please sign in to comment.