additional cleanup after switch from .beagle to .recollweb
This commit is contained in:
parent
453d88717d
commit
1a269751f5
7 changed files with 28 additions and 11 deletions
|
@ -991,6 +991,15 @@ string RclConfig::getIdxStatusFile() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string RclConfig::getWebQueueDir() const
|
||||||
|
{
|
||||||
|
string webqueuedir;
|
||||||
|
if (!getConfParam("webqueuedir", webqueuedir))
|
||||||
|
webqueuedir = "~/.recollweb/ToIndex/";
|
||||||
|
webqueuedir = path_tildexpand(webqueuedir);
|
||||||
|
return webqueuedir;
|
||||||
|
}
|
||||||
|
|
||||||
vector<string>& RclConfig::getSkippedNames()
|
vector<string>& RclConfig::getSkippedNames()
|
||||||
{
|
{
|
||||||
if (m_skpnstate.needrecompute()) {
|
if (m_skpnstate.needrecompute()) {
|
||||||
|
@ -1009,6 +1018,8 @@ vector<string> RclConfig::getSkippedPaths() const
|
||||||
// don't do this.
|
// don't do this.
|
||||||
skpl.push_back(getDbDir());
|
skpl.push_back(getDbDir());
|
||||||
skpl.push_back(getConfDir());
|
skpl.push_back(getConfDir());
|
||||||
|
// And the web queue dir
|
||||||
|
skpl.push_back(getWebQueueDir());
|
||||||
for (vector<string>::iterator it = skpl.begin(); it != skpl.end(); it++) {
|
for (vector<string>::iterator it = skpl.begin(); it != skpl.end(); it++) {
|
||||||
*it = path_tildexpand(*it);
|
*it = path_tildexpand(*it);
|
||||||
*it = path_canon(*it);
|
*it = path_canon(*it);
|
||||||
|
|
|
@ -155,6 +155,9 @@ class RclConfig {
|
||||||
/** Get indexing status file name */
|
/** Get indexing status file name */
|
||||||
string getIdxStatusFile() const;
|
string getIdxStatusFile() const;
|
||||||
|
|
||||||
|
/** Get Web Queue directory name */
|
||||||
|
string getWebQueueDir() const;
|
||||||
|
|
||||||
/** Get list of skipped file names for current keydir */
|
/** Get list of skipped file names for current keydir */
|
||||||
vector<string>& getSkippedNames();
|
vector<string>& getSkippedNames();
|
||||||
|
|
||||||
|
|
|
@ -180,11 +180,8 @@ BeagleQueueIndexer::BeagleQueueIndexer(RclConfig *cnf, Rcl::Db *db,
|
||||||
: m_config(cnf), m_db(db), m_cache(0), m_updater(updfunc),
|
: m_config(cnf), m_db(db), m_cache(0), m_updater(updfunc),
|
||||||
m_nocacheindex(false)
|
m_nocacheindex(false)
|
||||||
{
|
{
|
||||||
if (!m_config->getConfParam("webqueuedir", m_queuedir))
|
m_queuedir = m_config->getWebQueueDir();
|
||||||
m_queuedir = "~/.recollweb/ToIndex/";
|
|
||||||
m_queuedir = path_tildexpand(m_queuedir);
|
|
||||||
path_catslash(m_queuedir);
|
path_catslash(m_queuedir);
|
||||||
|
|
||||||
m_cache = new BeagleQueueCache(cnf);
|
m_cache = new BeagleQueueCache(cnf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,6 @@ bool FsIndexer::index()
|
||||||
}
|
}
|
||||||
|
|
||||||
m_walker.setSkippedPaths(m_config->getSkippedPaths());
|
m_walker.setSkippedPaths(m_config->getSkippedPaths());
|
||||||
m_walker.addSkippedPath(path_tildexpand("~/.beagle"));
|
|
||||||
for (vector<string>::const_iterator it = m_tdl.begin();
|
for (vector<string>::const_iterator it = m_tdl.begin();
|
||||||
it != m_tdl.end(); it++) {
|
it != m_tdl.end(); it++) {
|
||||||
LOGDEB(("FsIndexer::index: Indexing %s into %s\n", it->c_str(),
|
LOGDEB(("FsIndexer::index: Indexing %s into %s\n", it->c_str(),
|
||||||
|
@ -302,7 +301,6 @@ bool FsIndexer::indexFiles(list<string>& files, ConfIndexer::IxFlag flag)
|
||||||
// We use an FsTreeWalker just for handling the skipped path/name lists
|
// We use an FsTreeWalker just for handling the skipped path/name lists
|
||||||
FsTreeWalker walker;
|
FsTreeWalker walker;
|
||||||
walker.setSkippedPaths(m_config->getSkippedPaths());
|
walker.setSkippedPaths(m_config->getSkippedPaths());
|
||||||
m_walker.addSkippedPath(path_tildexpand("~/.beagle"));
|
|
||||||
|
|
||||||
for (list<string>::iterator it = files.begin(); it != files.end(); ) {
|
for (list<string>::iterator it = files.begin(); it != files.end(); ) {
|
||||||
LOGDEB2(("FsIndexer::indexFiles: [%s]\n", it->c_str()));
|
LOGDEB2(("FsIndexer::indexFiles: [%s]\n", it->c_str()));
|
||||||
|
|
|
@ -209,9 +209,7 @@ void *rclMonRcvRun(void *q)
|
||||||
bool doweb = false;
|
bool doweb = false;
|
||||||
lconfig.getConfParam("processwebqueue", &doweb);
|
lconfig.getConfParam("processwebqueue", &doweb);
|
||||||
if (doweb) {
|
if (doweb) {
|
||||||
string webqueuedir;
|
string webqueuedir = lconfig.getWebQueueDir();
|
||||||
if (!lconfig.getConfParam("webqueuedir", webqueuedir))
|
|
||||||
webqueuedir = path_tildexpand("~/.recollweb/ToIndex/");
|
|
||||||
if (!mon->addWatch(webqueuedir, true)) {
|
if (!mon->addWatch(webqueuedir, true)) {
|
||||||
LOGERR(("rclMonRcvRun: addwatch (webqueuedir) failed\n"));
|
LOGERR(("rclMonRcvRun: addwatch (webqueuedir) failed\n"));
|
||||||
if (mon->saved_errno != EACCES && mon->saved_errno != ENOENT)
|
if (mon->saved_errno != EACCES && mon->saved_errno != ENOENT)
|
||||||
|
|
|
@ -185,7 +185,7 @@ SearchData_addclause(recoll_SearchDataObject* self, PyObject *args,
|
||||||
char *qs = 0; // needs freeing
|
char *qs = 0; // needs freeing
|
||||||
int slack = 0;
|
int slack = 0;
|
||||||
char *fld = 0; // needs freeing
|
char *fld = 0; // needs freeing
|
||||||
int dostem = 1; // needs freeing
|
int dostem = 1;
|
||||||
recoll_SearchDataObject *sub = 0;
|
recoll_SearchDataObject *sub = 0;
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ses|iesiO!", (char**)kwlist,
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ses|iesiO!", (char**)kwlist,
|
||||||
&tp, "utf-8", &qs, &slack,
|
&tp, "utf-8", &qs, &slack,
|
||||||
|
|
|
@ -666,6 +666,7 @@ struct m_timespec {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CLOCK_REALTIME
|
#ifndef CLOCK_REALTIME
|
||||||
|
typedef int clockid_t;
|
||||||
#define CLOCK_REALTIME 1
|
#define CLOCK_REALTIME 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -675,10 +676,19 @@ struct m_timespec {
|
||||||
((TV).tv_nsec - m_nsecs) / 1000))
|
((TV).tv_nsec - m_nsecs) / 1000))
|
||||||
#define NANOS(TV) ( (long long)(((TV).tv_sec - m_secs) * 1000000000LL + \
|
#define NANOS(TV) ( (long long)(((TV).tv_sec - m_secs) * 1000000000LL + \
|
||||||
((TV).tv_nsec - m_nsecs)))
|
((TV).tv_nsec - m_nsecs)))
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
static void gettime(clockid_t clk_id, struct timespec *ts)
|
static void gettime(clockid_t clk_id, struct timespec *ts)
|
||||||
{
|
{
|
||||||
|
#ifdef __APPLE__
|
||||||
|
struct timeval tv;
|
||||||
|
gettimeofday(&tv, 0);
|
||||||
|
ts->tv_sec = tv.tv_sec;
|
||||||
|
ts->tv_nsec = tv.tv_usec * 1000;
|
||||||
|
#else
|
||||||
clock_gettime(clk_id, ts);
|
clock_gettime(clk_id, ts);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
///// End system interface
|
///// End system interface
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue