mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user