mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
Fix flag name and update error handling
This commit is contained in:
parent
701997d2fe
commit
42c132f421
1 changed files with 4 additions and 5 deletions
|
@ -728,7 +728,7 @@ optional<DebugCmd::PopulateOptions> DebugCmd::ParsePopulateArgs(CmdArgList args,
|
|||
|
||||
while (parser.HasNext()) {
|
||||
PopulateFlag flag = parser.MapNext("RAND", FLAG_RAND, "TYPE", FLAG_TYPE, "ELEMENTS",
|
||||
FLAG_ELEMENTS, "SLOT", FLAG_SLOT, "EXPIRE", FLAG_EXPIRE);
|
||||
FLAG_ELEMENTS, "SLOTS", FLAG_SLOT, "EXPIRE", FLAG_EXPIRE);
|
||||
switch (flag) {
|
||||
case FLAG_RAND:
|
||||
options.populate_random_values = true;
|
||||
|
@ -748,16 +748,15 @@ optional<DebugCmd::PopulateOptions> DebugCmd::ParsePopulateArgs(CmdArgList args,
|
|||
auto [min_ttl, max_ttl] = parser.Next<uint32_t, uint32_t>();
|
||||
if (min_ttl >= max_ttl) {
|
||||
builder->SendError(kExpiryOutOfRange);
|
||||
parser.Error();
|
||||
(void)parser.Error();
|
||||
return nullopt;
|
||||
}
|
||||
options.expire_ttl_range = std::make_pair(min_ttl, max_ttl);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LOG(ERROR) << "Error flag value in Populate arguments";
|
||||
builder->SendError(kSyntaxErr);
|
||||
return nullopt;
|
||||
LOG(FATAL) << "Unexpected flag in PopulateArgs. Args: " << args;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (parser.HasError()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue