usemtime config variable needs to be global
This commit is contained in:
parent
d630cbbaec
commit
cd892ee1a7
@ -60,6 +60,8 @@ typedef pair<int,int> RclPII;
|
|||||||
// We default to a case- and diacritics-less index for now
|
// We default to a case- and diacritics-less index for now
|
||||||
bool o_index_stripchars = true;
|
bool o_index_stripchars = true;
|
||||||
|
|
||||||
|
bool o_uptodate_test_use_mtime = false;
|
||||||
|
|
||||||
string RclConfig::o_localecharset;
|
string RclConfig::o_localecharset;
|
||||||
string RclConfig::o_origcwd;
|
string RclConfig::o_origcwd;
|
||||||
|
|
||||||
@ -342,6 +344,7 @@ bool RclConfig::updateMainConfig()
|
|||||||
static int m_index_stripchars_init = 0;
|
static int m_index_stripchars_init = 0;
|
||||||
if (!m_index_stripchars_init) {
|
if (!m_index_stripchars_init) {
|
||||||
getConfParam("indexStripChars", &o_index_stripchars);
|
getConfParam("indexStripChars", &o_index_stripchars);
|
||||||
|
getConfParam("testmodifusemtime", &o_uptodate_test_use_mtime);
|
||||||
m_index_stripchars_init = 1;
|
m_index_stripchars_init = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -379,4 +379,9 @@ class RclConfig {
|
|||||||
// reset. When using multiple indexes, all must have the same value
|
// reset. When using multiple indexes, all must have the same value
|
||||||
extern bool o_index_stripchars;
|
extern bool o_index_stripchars;
|
||||||
|
|
||||||
|
// This global variable defines if we use mtime instead of ctime for
|
||||||
|
// up-to-date tests. This is mostly incompatible with xattr indexing,
|
||||||
|
// in addition to other issues. See recoll.conf comments.
|
||||||
|
extern bool o_uptodate_test_use_mtime;
|
||||||
|
|
||||||
#endif /* _RCLCONFIG_H_INCLUDED_ */
|
#endif /* _RCLCONFIG_H_INCLUDED_ */
|
||||||
|
|||||||
@ -47,8 +47,6 @@
|
|||||||
#include "execmd.h"
|
#include "execmd.h"
|
||||||
#include "extrameta.h"
|
#include "extrameta.h"
|
||||||
|
|
||||||
int FsIndexer::o_tstupdusemtime = -1;
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#ifdef IDX_THREADS
|
#ifdef IDX_THREADS
|
||||||
@ -111,12 +109,6 @@ FsIndexer::FsIndexer(RclConfig *cnf, Rcl::Db *db, DbIxStatusUpdater *updfunc)
|
|||||||
m_havelocalfields = m_config->hasNameAnywhere("localfields");
|
m_havelocalfields = m_config->hasNameAnywhere("localfields");
|
||||||
m_config->getConfParam("detectxattronly", &m_detectxattronly);
|
m_config->getConfParam("detectxattronly", &m_detectxattronly);
|
||||||
|
|
||||||
if (o_tstupdusemtime == -1) {
|
|
||||||
bool b(false);
|
|
||||||
m_config->getConfParam("testmodifusemtime", &b);
|
|
||||||
o_tstupdusemtime = b ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef IDX_THREADS
|
#ifdef IDX_THREADS
|
||||||
m_stableconfig = new RclConfig(*m_config);
|
m_stableconfig = new RclConfig(*m_config);
|
||||||
m_loglevel = DebugLog::getdbl()->getlevel();
|
m_loglevel = DebugLog::getdbl()->getlevel();
|
||||||
@ -497,7 +489,8 @@ void FsIndexer::makesig(const struct stat *stp, string& out)
|
|||||||
{
|
{
|
||||||
char cbuf[100];
|
char cbuf[100];
|
||||||
sprintf(cbuf, "%lld" "%ld", (long long)stp->st_size,
|
sprintf(cbuf, "%lld" "%ld", (long long)stp->st_size,
|
||||||
o_tstupdusemtime ? (long)stp->st_mtime : (long)stp->st_ctime);
|
o_uptodate_test_use_mtime ?
|
||||||
|
(long)stp->st_mtime : (long)stp->st_ctime);
|
||||||
out = cbuf;
|
out = cbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -135,10 +135,6 @@ class FsIndexer : public FsTreeWalkerCB {
|
|||||||
// Activate detection of xattr-only document updates. Experimental, so
|
// Activate detection of xattr-only document updates. Experimental, so
|
||||||
// needs a config option
|
// needs a config option
|
||||||
bool m_detectxattronly;
|
bool m_detectxattronly;
|
||||||
// Use mtime instead of ctime for up-to-date tests. This is mostly
|
|
||||||
// incompatible with xattr indexing, in addition to other
|
|
||||||
// issues. See recoll.conf comments.
|
|
||||||
static int o_tstupdusemtime;
|
|
||||||
|
|
||||||
#ifdef IDX_THREADS
|
#ifdef IDX_THREADS
|
||||||
friend void *FsIndexerDbUpdWorker(void*);
|
friend void *FsIndexerDbUpdWorker(void*);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user