Commit 165af023 authored by Alessio Netti's avatar Alessio Netti
Browse files

Minor changes

- MaxMsgNum configuration parameter now defaults to 0 (no message cap)
- The sensor hierarchy string is now logged at startup
- A rebuild of the SensorNavigator is now triggered only at plugin
reloads over the REST API
parent 07fe0654
...@@ -31,7 +31,7 @@ Configuration::Configuration(const std::string& cfgFilePath) : ...@@ -31,7 +31,7 @@ Configuration::Configuration(const std::string& cfgFilePath) :
_global.brokerHost = ""; _global.brokerHost = "";
_global.brokerPort = 1883; _global.brokerPort = 1883;
_global.threads = 1; _global.threads = 1;
_global.maxMsgNum = 100; _global.maxMsgNum = 0;
_global.maxInflightMsgNum = 20; _global.maxInflightMsgNum = 20;
_global.maxQueuedMsgNum = 0; _global.maxQueuedMsgNum = 0;
_global.logLevelFile = boost::log::trivial::trace; _global.logLevelFile = boost::log::trivial::trace;
......
...@@ -371,19 +371,21 @@ void HttpsServer::requestHandler::operator()(server::request const &request, ser ...@@ -371,19 +371,21 @@ void HttpsServer::requestHandler::operator()(server::request const &request, ser
goto error; goto error;
} }
//Updating the SensorNavigator on plugin changes //Updating the SensorNavigator on plugin reloads
QueryEngine &qEngine = QueryEngine::getInstance(); if(action == "reload") {
std::shared_ptr <SensorNavigator> navigator = std::make_shared<SensorNavigator>(); QueryEngine &qEngine = QueryEngine::getInstance();
vector <std::string> names, topics; std::shared_ptr <SensorNavigator> navigator = std::make_shared<SensorNavigator>();
for (const auto &p : _httpsServer._plugins) vector <std::string> names, topics;
for (const auto &g : p.configurator->getSensorGroups()) for (const auto &p : _httpsServer._plugins)
for (const auto &s : g->getSensors()) { for (const auto &g : p.configurator->getSensorGroups())
names.push_back(s->getName()); for (const auto &s : g->getSensors()) {
topics.push_back(s->getMqtt()); names.push_back(s->getName());
} topics.push_back(s->getMqtt());
navigator->buildTree(qEngine.getSensorHierarchy(), &names, &topics); }
qEngine.setNavigator(navigator); navigator->buildTree(qEngine.getSensorHierarchy(), &names, &topics);
qEngine.triggerUpdate(); qEngine.setNavigator(navigator);
qEngine.triggerUpdate();
}
} }
} }
......
...@@ -329,6 +329,7 @@ int main(int argc, char** argv) { ...@@ -329,6 +329,7 @@ int main(int argc, char** argv) {
LOG(info) << " MQTT-QoS: " << globalSettings.qosLevel; LOG(info) << " MQTT-QoS: " << globalSettings.qosLevel;
LOG(info) << " MQTT-prefix: " << pluginSettings.mqttPrefix; LOG(info) << " MQTT-prefix: " << pluginSettings.mqttPrefix;
LOG(info) << " Write-Dir: " << pluginSettings.tempdir; LOG(info) << " Write-Dir: " << pluginSettings.tempdir;
LOG(info) << " Hierarchy: " << globalSettings.hierarchy;
LOG(info) << " CacheInterval: " << pluginSettings.cacheInterval / 1000 << " [s]"; LOG(info) << " CacheInterval: " << pluginSettings.cacheInterval / 1000 << " [s]";
if(globalSettings.validateConfig) { if(globalSettings.validateConfig) {
LOG(info) << " Only validating config files."; LOG(info) << " Only validating config files.";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment