add skippedPaths and daemSkippedPaths config variables

This commit is contained in:
dockes
2007-02-02 10:12:58 +00:00
parent 68b25b750c
commit fde963eb2e
5 changed files with 72 additions and 32 deletions
+2 -5
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.50 2006-12-21 09:22:31 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.51 2007-02-02 10:12:58 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -82,10 +82,7 @@ bool DbIndexer::indexDb(bool resetbefore, list<string> *topdirs)
m_updater->status.dbtotdocs = m_db.docCnt();
}
// Always add dbdir and confdir to skipped paths.
m_walker.setSkippedPaths(list<string>());
m_walker.addSkippedPath(m_config->getConfDir());
m_walker.addSkippedPath(m_dbdir);
m_walker.setSkippedPaths(m_config->getSkippedPaths());
for (list<string>::const_iterator it = topdirs->begin();
it != topdirs->end(); it++) {
+9 -4
View File
@@ -1,7 +1,7 @@
#include "autoconfig.h"
#ifdef RCL_MONITOR
#ifndef lint
static char rcsid[] = "@(#$Id: rclmonrcv.cpp,v 1.9 2006-12-21 09:22:31 dockes Exp $ (C) 2006 J.F.Dockes";
static char rcsid[] = "@(#$Id: rclmonrcv.cpp,v 1.10 2007-02-02 10:12:58 dockes Exp $ (C) 2006 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -128,13 +128,18 @@ void *rclMonRcvRun(void *q)
// Walk the directory trees to add watches
FsTreeWalker walker;
walker.addSkippedPath(queue->getConfig()->getConfDir());
walker.setSkippedPaths(queue->getConfig()->getDaemSkippedPaths());
WalkCB walkcb(queue->getConfig(), mon, queue);
for (list<string>::iterator it = tdl.begin(); it != tdl.end(); it++) {
queue->getConfig()->setKeyDir(*it);
// Adjust the skipped names according to config, and add the dbdir to
// skipped paths
// Adjust the skipped names according to config
walker.setSkippedNames(queue->getConfig()->getSkippedNames());
// Add the dbdir to skipped paths. Note that adding the dbdir
// is probably not useful as we'll probably never have
// multiple dbs per config file, and the global dbdir is
// included by
// config->getSkippedPaths(). Still, better to be safe here as
// config->including dbdir in the walk will get us into a loop
walker.addSkippedPath(queue->getConfig()->getDbDir());
LOGDEB(("rclMonRcvRun: walking %s\n", it->c_str()));
walker.walk(*it, walkcb);