from 1.18 branch: Adjust things for using the new Firefox plugin: remove visible Beagle references + fix 1.18 web queue indexing bugs

This commit is contained in:
Jean-Francois Dockes
2012-11-01 11:30:39 +01:00
parent 04c19b33d5
commit 5fc8f240fe
25 changed files with 1420 additions and 1167 deletions
+8 -2
View File
@@ -19,6 +19,7 @@
#include <unistd.h>
#include <sys/types.h>
#include <string.h>
#include <errno.h>
#include "cstr.h"
#include "pathut.h"
@@ -179,8 +180,8 @@ BeagleQueueIndexer::BeagleQueueIndexer(RclConfig *cnf, Rcl::Db *db,
: m_config(cnf), m_db(db), m_cache(0), m_updater(updfunc),
m_nocacheindex(false)
{
if (!m_config->getConfParam("beaglequeuedir", m_queuedir))
m_queuedir = "~/.beagle/ToIndex/";
if (!m_config->getConfParam("webqueuedir", m_queuedir))
m_queuedir = "~/.recollweb/ToIndex/";
m_queuedir = path_tildexpand(m_queuedir);
path_catslash(m_queuedir);
@@ -269,6 +270,11 @@ bool BeagleQueueIndexer::index()
return false;
LOGDEB(("BeagleQueueIndexer::processqueue: [%s]\n", m_queuedir.c_str()));
m_config->setKeyDir(m_queuedir);
if (!makepath(m_queuedir)) {
LOGERR(("BeagleQueueIndexer:: can't create queuedir [%s] errno %d\n",
m_queuedir.c_str(), errno));
return false;
}
if (!m_cache || !m_cache->cc()) {
LOGERR(("BeagleQueueIndexer: cache initialization failed\n"));
return false;
+2 -2
View File
@@ -41,7 +41,6 @@ bool BGLDocFetcher::fetch(RclConfig* cnf, const Rcl::Doc& idoc, RawDoc& out)
LOGERR(("BGLDocFetcher:: no udi in idoc\n"));
return false;
}
string data;
Rcl::Doc dotdoc;
{
PTMutexLocker locker(o_beagler_mutex);
@@ -49,7 +48,7 @@ bool BGLDocFetcher::fetch(RclConfig* cnf, const Rcl::Doc& idoc, RawDoc& out)
// object is created at the first call of this routine and
// deleted when the program exits.
static BeagleQueueCache o_beagler(cnf);
if (!o_beagler.getFromCache(udi, dotdoc, data)) {
if (!o_beagler.getFromCache(udi, dotdoc, out.data)) {
LOGINFO(("BGLDocFetcher::fetch: failed for [%s]\n", udi.c_str()));
return false;
}
@@ -58,6 +57,7 @@ bool BGLDocFetcher::fetch(RclConfig* cnf, const Rcl::Doc& idoc, RawDoc& out)
LOGINFO(("BGLDocFetcher:: udi [%s], mimetp mismatch: in: [%s], bgl "
"[%s]\n", idoc.mimetype.c_str(), dotdoc.mimetype.c_str()));
}
out.kind = RawDoc::RDK_DATA;
return true;
}
+1 -1
View File
@@ -41,7 +41,7 @@ ConfIndexer::ConfIndexer(RclConfig *cnf, DbIxStatusUpdater *updfunc)
m_dobeagle(false), m_beagler(0),
m_updater(updfunc)
{
m_config->getConfParam("processbeaglequeue", &m_dobeagle);
m_config->getConfParam("processwebqueue", &m_dobeagle);
}
ConfIndexer::~ConfIndexer()
+8 -8
View File
@@ -206,14 +206,14 @@ void *rclMonRcvRun(void *q)
}
{
bool dobeagle = false;
lconfig.getConfParam("processbeaglequeue", &dobeagle);
if (dobeagle) {
string beaglequeuedir;
if (!lconfig.getConfParam("beaglequeuedir", beaglequeuedir))
beaglequeuedir = path_tildexpand("~/.beagle/ToIndex/");
if (!mon->addWatch(beaglequeuedir, true)) {
LOGERR(("rclMonRcvRun: addwatch (beaglequeuedit) failed\n"));
bool doweb = false;
lconfig.getConfParam("processwebqueue", &doweb);
if (doweb) {
string webqueuedir;
if (!lconfig.getConfParam("webqueuedir", webqueuedir))
webqueuedir = path_tildexpand("~/.recollweb/ToIndex/");
if (!mon->addWatch(webqueuedir, true)) {
LOGERR(("rclMonRcvRun: addwatch (webqueuedir) failed\n"));
if (mon->saved_errno != EACCES && mon->saved_errno != ENOENT)
goto terminate;
}