Use PTMutexLocker in workqueue, and make it restartable

This commit is contained in:
Jean-Francois Dockes
2012-11-30 07:35:03 +01:00
parent 9146929f5e
commit 3a33a68e2d
6 changed files with 38 additions and 35 deletions
+5 -1
View File
@@ -64,6 +64,7 @@ bool ConfIndexer::index(bool resetbefore, ixType typestorun)
deleteZ(m_fsindexer);
m_fsindexer = new FsIndexer(m_config, &m_db, m_updater);
if (!m_fsindexer || !m_fsindexer->index()) {
m_db.close();
return false;
}
}
@@ -72,6 +73,7 @@ bool ConfIndexer::index(bool resetbefore, ixType typestorun)
deleteZ(m_beagler);
m_beagler = new BeagleQueueIndexer(m_config, &m_db, m_updater);
if (!m_beagler || !m_beagler->index()) {
m_db.close();
return false;
}
}
@@ -79,8 +81,10 @@ bool ConfIndexer::index(bool resetbefore, ixType typestorun)
if (typestorun == IxTAll) {
// Get rid of all database entries that don't exist in the
// filesystem anymore. Only if all *configured* indexers ran.
if (m_updater && !m_updater->update(DbIxStatus::DBIXS_PURGE, string()))
if (m_updater && !m_updater->update(DbIxStatus::DBIXS_PURGE, string())) {
m_db.close();
return false;
}
m_db.purge();
}
+1 -2
View File
@@ -471,8 +471,7 @@ int main(int argc, char **argv)
}
deleteZ(confindexer);
o_reexec->insertArgs(vector<string>(1, "-n"));
LOGDEB(("recollindex: calling reexec after init path with "
"option -n\n"));
LOGINFO(("recollindex: reexecuting with -n after initial full pass\n"));
// Note that -n will be inside the reexec when we come
// back, but the monitor will explicitely strip it before
// starting a config change exec to ensure that we do a