Commit 148ef195 authored by Alessio Netti's avatar Alessio Netti
Browse files

Pusher/Collectagent does not abort anymore if Sensor Navigator cannot be loaded

parent 44cf05f2
......@@ -62,16 +62,15 @@ bool AnalyticsController::initialize(Configuration& settings, const string& conf
try {
_navigator->setFilter(_settings.analyticsSettings.filter);
_navigator->buildTree(_settings.analyticsSettings.hierarchy, &topics);
LOG(info) << "Built a sensor hierarchy tree of size " << _navigator->getTreeSize() << " and depth " << _navigator->getTreeDepth() << ".";
} catch (const std::invalid_argument &e) {
_navigator->clearTree();
LOG(error) << e.what();
LOG(error) << "Failed to build sensor hierarchy tree!";
return false;
}
LOG(info) << "Built a sensor hierarchy tree of size " << _navigator->getTreeSize() << " and depth "
<< _navigator->getTreeDepth() << ".";
topics.clear();
// Assigning the newly-built sensor navigator to the QueryEngine
// Assigning the newly-built sensor navigator to the QueryEngine (even if uninitialized)
_queryEngine.setNavigator(_navigator);
}
......
......@@ -273,12 +273,12 @@ int main(int argc, char** argv) {
navigator->buildTree(analyticsSettings.hierarchy, &topics);
topics.clear();
LOG(info) << "Built a sensor hierarchy tree of size " << navigator->getTreeSize() << " and depth " << navigator->getTreeDepth() << ".";
_queryEngine.setNavigator(navigator);
} catch (const std::invalid_argument &e) {
navigator->clearTree();
LOG(error) << e.what();
LOG(error) << "Failed to build sensor hierarchy tree!";
return 1;
}
_queryEngine.setNavigator(navigator);
}
_queryEngine.setFilter(analyticsSettings.filter);
......
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