From 91c5a9bac5c3bc71f6db494f3c861d8161d60371 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Thu, 6 Jul 2023 20:33:10 +0300 Subject: [PATCH] store: only write last-change _once_ xapian-db does it, no longer needed in store.cc --- lib/mu-store.cc | 2 -- lib/mu-xapian-db.cc | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/mu-store.cc b/lib/mu-store.cc index 980a7198..8700aec1 100644 --- a/lib/mu-store.cc +++ b/lib/mu-store.cc @@ -347,7 +347,6 @@ Store::remove_message(const std::string& path) std::lock_guard guard{priv_->lock_}; const auto term{field_from_id(Field::Id::Path).xapian_term(path)}; xapian_db().delete_document(term); - config().set(::time({})); g_debug("deleted message @ %s from store", path.c_str()); return true; } @@ -362,7 +361,6 @@ Store::remove_messages(const std::vector& ids) for (auto&& id : ids) xapian_db().delete_document(id); - config().set(::time({})); priv_->transaction_maybe_commit(true /*force*/); } diff --git a/lib/mu-xapian-db.cc b/lib/mu-xapian-db.cc index ca9cd8d5..d2ffc2fa 100644 --- a/lib/mu-xapian-db.cc +++ b/lib/mu-xapian-db.cc @@ -89,8 +89,7 @@ XapianDb::lock() const void XapianDb::set_timestamp(const std::string_view key) { - wdb().set_metadata(std::string{key}, - format("%" PRIi64, static_cast(::time({})))); + wdb().set_metadata(std::string{key}, mu_format("{}", ::time({}))); } Result