1
This commit is contained in:
parent
4210cf3813
commit
924ae0c500
@ -464,8 +464,13 @@ void App::UnInitLog()
|
||||
bool App::ParseOpt()
|
||||
{
|
||||
int ch = 0;
|
||||
while ((ch = getopt(argc, argv, "i:t:r:f:n:")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "z:i:t:r:f:n:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'z':
|
||||
{
|
||||
zone_id = a8::XValue(optarg);
|
||||
}
|
||||
break;
|
||||
case 'n':
|
||||
{
|
||||
node_id = a8::XValue(optarg);
|
||||
@ -493,12 +498,13 @@ bool App::ParseOpt()
|
||||
break;
|
||||
}
|
||||
}
|
||||
return instance_id > 0 && node_id > 0;
|
||||
return zone_id > 0 && instance_id > 0 && node_id > 0;
|
||||
}
|
||||
|
||||
std::string App::NewUuid()
|
||||
{
|
||||
return a8::XValue(uuid.Generate()).GetString();
|
||||
std::string id = a8::Format("%d%d", {zone_id, uuid.Generate()});
|
||||
return id;
|
||||
}
|
||||
|
||||
bool App::HasFlag(int flag)
|
||||
|
@ -62,6 +62,7 @@ public:
|
||||
a8::uuid::SnowFlake uuid;
|
||||
|
||||
public:
|
||||
int zone_id = 0;
|
||||
int instance_id = 0;
|
||||
int node_id = 0;
|
||||
bool is_test_mode = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user