mirror of
https://github.com/joyieldInc/predixy.git
synced 2025-12-24 22:46:41 +08:00
Remove type in Conf
This commit is contained in:
parent
a13bb36159
commit
bf635bbfab
@ -203,8 +203,7 @@ void Command::addCustomCommand(const CustomCommandConf& ccc) {
|
||||
p->minArgs = ccc.minArgs;
|
||||
p->maxArgs = ccc.maxArgs;
|
||||
p->mode = ccc.mode;
|
||||
p->type = (Command::Type)ccc.type;
|
||||
p->type = (Command::Type)Sentinel++;
|
||||
CmdMap[ccc.name] = p;
|
||||
Sentinel++;
|
||||
}
|
||||
|
||||
|
||||
@ -33,9 +33,8 @@ bool ServerConf::parse(ServerConf& s, const char* str)
|
||||
return !s.addr.empty();
|
||||
}
|
||||
|
||||
void CustomCommandConf::init(CustomCommandConf&c, const char* name, const int type) {
|
||||
void CustomCommandConf::init(CustomCommandConf&c, const char* name) {
|
||||
c.name = name;
|
||||
c.type = type;
|
||||
c.minArgs = 2;
|
||||
c.maxArgs = 2;
|
||||
c.mode = Command::Write;
|
||||
@ -381,7 +380,7 @@ void Conf::setCustomCommand(const ConfParser::Node* node)
|
||||
for (auto p = node->sub; p; p = p->next) {
|
||||
mCustomCommands.push_back(CustomCommandConf{});
|
||||
auto& cc = mCustomCommands.back();
|
||||
CustomCommandConf::init(cc, p->key.c_str(), Command::Sentinel);
|
||||
CustomCommandConf::init(cc, p->key.c_str());
|
||||
auto s = p->sub;
|
||||
for (;s ; s = s->next) {
|
||||
if (setInt(cc.minArgs, "MinArgs", s, 2)) {
|
||||
|
||||
@ -97,12 +97,11 @@ struct LatencyMonitorConf
|
||||
struct CustomCommandConf
|
||||
{
|
||||
std::string name;
|
||||
int type;
|
||||
int minArgs;
|
||||
int maxArgs;
|
||||
int mode;
|
||||
|
||||
static void init(CustomCommandConf &c, const char* name, const int type);
|
||||
static void init(CustomCommandConf &c, const char* name);
|
||||
};
|
||||
|
||||
class Conf
|
||||
|
||||
Loading…
Reference in New Issue
Block a user