Commit 211a0a7e authored by Alessio Netti's avatar Alessio Netti
Browse files

Analytics: minor fixes

parent b4830c2b
...@@ -85,7 +85,7 @@ bool sensorQueryCallback(const string &name, const uint64_t startTs, const uint6 ...@@ -85,7 +85,7 @@ bool sensorQueryCallback(const string &name, const uint64_t startTs, const uint6
bool found = false; bool found = false;
++_queryEngine.access; ++_queryEngine.access;
shared_ptr<map<string, SBasePtr>> sensorMap = _queryEngine.getSensorMap(); shared_ptr<map<string, SBasePtr>> sensorMap = _queryEngine.getSensorMap();
if (sensorMap != nullptr && sensorMap->count(name) > 0) { if (sensorMap != nullptr && sensorMap->count(name) > 0) {
SBasePtr sensor = sensorMap->at(name); SBasePtr sensor = sensorMap->at(name);
found = sensor->isInit() ? sensor->getCache()->getView(startTs, endTs, buffer, rel) : false; found = sensor->isInit() ? sensor->getCache()->getView(startTs, endTs, buffer, rel) : false;
...@@ -99,8 +99,9 @@ bool sensorGroupQueryCallback(const std::vector<string> &names, const uint64_t s ...@@ -99,8 +99,9 @@ bool sensorGroupQueryCallback(const std::vector<string> &names, const uint64_t s
if (_queryEngine.updating.load()) if (_queryEngine.updating.load())
return false; return false;
bool outcome = false; bool outcome = false;
for(const auto& name : names) for(const auto& name : names) {
outcome = outcome || sensorQueryCallback(name, startTs, endTs, buffer, rel); outcome = sensorQueryCallback(name, startTs, endTs, buffer, rel) || outcome;
}
return outcome; return outcome;
} }
......
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