Allow defining monitordirs variable: subset/dir of topdirs which will get monitored for updates
This commit is contained in:
@@ -585,18 +585,24 @@ pair<int,int> RclConfig::getThrConf(ThrStage who) const
|
||||
return m_thrConf[who];
|
||||
}
|
||||
|
||||
vector<string> RclConfig::getTopdirs() const
|
||||
vector<string> RclConfig::getTopdirs(bool formonitor) const
|
||||
{
|
||||
vector<string> tdl;
|
||||
if (!getConfParam("topdirs", &tdl)) {
|
||||
LOGERR("RclConfig::getTopdirs: no top directories in config or "
|
||||
"bad list format\n");
|
||||
if (formonitor) {
|
||||
if (!getConfParam("monitordirs", &tdl)) {
|
||||
getConfParam("topdirs", &tdl);
|
||||
}
|
||||
} else {
|
||||
getConfParam("topdirs", &tdl);
|
||||
}
|
||||
if (tdl.empty()) {
|
||||
LOGERR("RclConfig::getTopdirs: nothing to index: topdirs/monitordirs "
|
||||
" are not set or have a bad list format\n");
|
||||
return tdl;
|
||||
}
|
||||
|
||||
for (vector<string>::iterator it = tdl.begin(); it != tdl.end(); it++) {
|
||||
*it = path_tildexpand(*it);
|
||||
*it = path_canon(*it);
|
||||
for (auto& dir : tdl) {
|
||||
dir = path_canon(path_tildexpand(dir));
|
||||
}
|
||||
return tdl;
|
||||
}
|
||||
|
||||
@@ -182,8 +182,11 @@ class RclConfig {
|
||||
|
||||
/** Get list of top directories. This is needed from a number of places
|
||||
* and needs some cleaning-up code. An empty list is always an error, no
|
||||
* need for other status */
|
||||
vector<string> getTopdirs() const;
|
||||
* need for other status
|
||||
* @param formonitor if set retrieve the list for real time monitoring
|
||||
* (if the monitor list does not exist we return the normal one).
|
||||
*/
|
||||
vector<string> getTopdirs(bool formonitor = false) const;
|
||||
|
||||
string getConfdirPath(const char *varname, const char *dflt) const;
|
||||
string getCachedirPath(const char *varname, const char *dflt) const;
|
||||
|
||||
Reference in New Issue
Block a user