separated out the cache access part from beaglequeueindexer. this avoids having to link the pure query programs with indexing code
This commit is contained in:
@@ -45,7 +45,7 @@ using namespace std;
|
||||
#include "rclconfig.h"
|
||||
#include "mh_html.h"
|
||||
#include "fileudi.h"
|
||||
#include "beaglequeue.h"
|
||||
#include "beaglequeuecache.h"
|
||||
#include "cancelcheck.h"
|
||||
|
||||
#ifdef RCL_USE_XATTR
|
||||
@@ -390,14 +390,10 @@ FileInterner::FileInterner(const Rcl::Doc& idoc, RclConfig *cnf,
|
||||
}
|
||||
init(fn, &st, cnf, td, flags, &idoc.mimetype);
|
||||
} else if (!backend.compare("BGL")) {
|
||||
// Retrieve from our webcache (beagle data). There should
|
||||
// probably be a separate object type for readonly cache
|
||||
// access (distinct from the one used for indexing).
|
||||
// Anyway, we're not called in the same thread as indexing ops, and
|
||||
// even, at worse, this would duplicate the memory used. The beagler
|
||||
// object is created at the first call of this routine and deleted
|
||||
// when the program exits.
|
||||
static BeagleQueueIndexer beagler(cnf);
|
||||
// Retrieve from our webcache (beagle data). The beagler
|
||||
// object is created at the first call of this routine and
|
||||
// deleted when the program exits.
|
||||
static BeagleQueueCache beagler(cnf);
|
||||
string data;
|
||||
Rcl::Doc dotdoc;
|
||||
map<string,string>::const_iterator it =
|
||||
|
||||
@@ -494,6 +494,7 @@ bool MimeHandlerMbox::next_document()
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
#include "rclconfig.h"
|
||||
#include "rclinit.h"
|
||||
#include "mh_mbox.h"
|
||||
|
||||
@@ -508,6 +509,11 @@ Usage(void)
|
||||
fprintf(stderr, "%s: usage:\n%s", thisprog, usage);
|
||||
exit(1);
|
||||
}
|
||||
static RclConfig *config;
|
||||
RclConfig *RclConfig::getMainConfig()
|
||||
{
|
||||
return config;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@@ -530,8 +536,8 @@ int main(int argc, char **argv)
|
||||
Usage();
|
||||
string filename = *argv++;argc--;
|
||||
string reason;
|
||||
RclConfig *conf = recollinit(RclInitFlags(0), 0, 0, reason, 0);
|
||||
if (conf == 0) {
|
||||
config = recollinit(RclInitFlags(0), 0, 0, reason, 0);
|
||||
if (config == 0) {
|
||||
cerr << "init failed " << reason << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user