Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
parent
7ff30f5b30
commit
7c4a5bc37c
1 changed files with 11 additions and 10 deletions
|
|
@ -107,18 +107,17 @@ void Metric::LoadFromConfigs()
|
|||
}
|
||||
|
||||
std::vector<std::string_view> tokens = Acore::Tokenize(connectionInfo, ';', true);
|
||||
if (tokens.size() != 2)
|
||||
{
|
||||
LOG_ERROR("metric", "Metric.InfluxDB.Connection specified with wrong format in configuration file.");
|
||||
return;
|
||||
}
|
||||
|
||||
_hostname.assign(tokens[0]);
|
||||
_port.assign(tokens[1]);
|
||||
|
||||
_useV2 = sConfigMgr->GetOption<bool>("Metric.InfluxDB.v2", false);
|
||||
if (_useV2)
|
||||
{
|
||||
if (tokens.size() != 2)
|
||||
{
|
||||
LOG_ERROR("metric", "Metric.InfluxDB.Connection specified with wrong format in configuration file. (hostname;port)");
|
||||
return;
|
||||
}
|
||||
|
||||
_hostname.assign(tokens[0]);
|
||||
_port.assign(tokens[1]);
|
||||
_org = sConfigMgr->GetOption<std::string>("Metric.InfluxDB.Org", "");
|
||||
_bucket = sConfigMgr->GetOption<std::string>("Metric.InfluxDB.Bucket", "");
|
||||
_token = sConfigMgr->GetOption<std::string>("Metric.InfluxDB.Token", "");
|
||||
|
|
@ -133,10 +132,12 @@ void Metric::LoadFromConfigs()
|
|||
{
|
||||
if (tokens.size() != 3)
|
||||
{
|
||||
LOG_ERROR("metric", "Metric.InfluxDB.Connection specified with wrong format in configuration file.");
|
||||
LOG_ERROR("metric", "Metric.InfluxDB.Connection specified with wrong format in configuration file. (hostname;port;database)");
|
||||
return;
|
||||
}
|
||||
|
||||
_hostname.assign(tokens[0]);
|
||||
_port.assign(tokens[1]);
|
||||
_databaseName.assign(tokens[2]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue