index: save/commit metadata after messages

Ensure the metadata (dirstamps) for messages are only written / committed _after_
the accompanying message have been written / committed.

This avoids missing updates when indexing gets terminated unexpectedly.
This commit is contained in:
Dirk-Jan C. Binnema
2022-02-03 22:51:02 +02:00
parent 12658a3dc6
commit 05393ba797
5 changed files with 174 additions and 113 deletions

View File

@ -303,8 +303,10 @@ public:
*
* @param path a filesystem path
* @param tstamp the timestamp for that path
* @param whether to do this as part of a transaction
*/
void set_dirstamp(const std::string& path, time_t tstamp);
void set_dirstamp(const std::string& path, time_t tstamp,
bool use_transaction = false);
/**
* Get the number of documents in the document database