mirror of https://github.com/djcb/mu.git
store: only write last-change _once_
xapian-db does it, no longer needed in store.cc
This commit is contained in:
parent
d96e9cc4ba
commit
91c5a9bac5
|
@ -347,7 +347,6 @@ Store::remove_message(const std::string& path)
|
||||||
std::lock_guard guard{priv_->lock_};
|
std::lock_guard guard{priv_->lock_};
|
||||||
const auto term{field_from_id(Field::Id::Path).xapian_term(path)};
|
const auto term{field_from_id(Field::Id::Path).xapian_term(path)};
|
||||||
xapian_db().delete_document(term);
|
xapian_db().delete_document(term);
|
||||||
config().set<Config::Id::LastChange>(::time({}));
|
|
||||||
g_debug("deleted message @ %s from store", path.c_str());
|
g_debug("deleted message @ %s from store", path.c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -362,7 +361,6 @@ Store::remove_messages(const std::vector<Store::Id>& ids)
|
||||||
for (auto&& id : ids)
|
for (auto&& id : ids)
|
||||||
xapian_db().delete_document(id);
|
xapian_db().delete_document(id);
|
||||||
|
|
||||||
config().set<Config::Id::LastChange>(::time({}));
|
|
||||||
priv_->transaction_maybe_commit(true /*force*/);
|
priv_->transaction_maybe_commit(true /*force*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,8 +89,7 @@ XapianDb::lock() const
|
||||||
void
|
void
|
||||||
XapianDb::set_timestamp(const std::string_view key)
|
XapianDb::set_timestamp(const std::string_view key)
|
||||||
{
|
{
|
||||||
wdb().set_metadata(std::string{key},
|
wdb().set_metadata(std::string{key}, mu_format("{}", ::time({})));
|
||||||
format("%" PRIi64, static_cast<int64_t>(::time({}))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<XapianDb>
|
Result<XapianDb>
|
||||||
|
|
Loading…
Reference in New Issue