removed the useless keep_updated flag
This commit is contained in:
parent
e9b5174867
commit
645af1aa55
@ -512,7 +512,7 @@ list<string> Db::getStemmerNames()
|
||||
return res;
|
||||
}
|
||||
|
||||
bool Db::open(OpenMode mode, bool keep_updated)
|
||||
bool Db::open(OpenMode mode)
|
||||
{
|
||||
if (m_ndb == 0 || m_config == 0) {
|
||||
m_reason = "Null configuration or Xapian Db";
|
||||
@ -547,12 +547,10 @@ bool Db::open(OpenMode mode, bool keep_updated)
|
||||
m_ndb->xrdb = Xapian::Database(dir);
|
||||
LOGDEB(("Db::open: lastdocid: %d\n",
|
||||
m_ndb->xwdb.get_lastdocid()));
|
||||
if (!keep_updated) {
|
||||
LOGDEB2(("Db::open: resetting updated\n"));
|
||||
updated.resize(m_ndb->xwdb.get_lastdocid() + 1);
|
||||
for (unsigned int i = 0; i < updated.size(); i++)
|
||||
updated[i] = false;
|
||||
}
|
||||
LOGDEB2(("Db::open: resetting updated\n"));
|
||||
updated.resize(m_ndb->xwdb.get_lastdocid() + 1);
|
||||
for (unsigned int i = 0; i < updated.size(); i++)
|
||||
updated[i] = false;
|
||||
}
|
||||
break;
|
||||
case DbRO:
|
||||
@ -640,10 +638,14 @@ bool Db::i_close(bool final)
|
||||
// Reopen the db with a changed list of additional dbs
|
||||
bool Db::adjustdbs()
|
||||
{
|
||||
if (m_mode != DbRO) {
|
||||
LOGERR(("Db::adjustdbs: mode not RO\n"));
|
||||
return false;
|
||||
}
|
||||
if (m_ndb && m_ndb->m_isopen) {
|
||||
if (!close())
|
||||
return false;
|
||||
if (!open(m_mode, true)) {
|
||||
if (!open(m_mode)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ using std::vector;
|
||||
// user interface. In other words, this is not exhaustive or well-designed or
|
||||
// reusable.
|
||||
//
|
||||
// Unique Document Identifier: unically identifies a document in its
|
||||
// Unique Document Identifier: uniquely identifies a document in its
|
||||
// source storage (file system or other). Used for up to date checks
|
||||
// etc. "udi". Our user is responsible for making sure it's not too
|
||||
// big, cause it's stored as a Xapian term (< 150 bytes would be
|
||||
@ -86,7 +86,7 @@ class Db {
|
||||
~Db();
|
||||
|
||||
enum OpenMode {DbRO, DbUpd, DbTrunc};
|
||||
bool open(OpenMode mode, bool keep_updated = false);
|
||||
bool open(OpenMode mode);
|
||||
bool close();
|
||||
bool isopen();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user