From 5da066a59e97bb838f726deff16ca92dca3bb672 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Thu, 5 May 2022 01:16:57 +0300 Subject: [PATCH] indexer: use ctime, not mtime So we update if _anything_ changes with the file, not just the contents. --- lib/index/mu-indexer.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/index/mu-indexer.cc b/lib/index/mu-indexer.cc index 1f90bc72..72a83ea3 100644 --- a/lib/index/mu-indexer.cc +++ b/lib/index/mu-indexer.cc @@ -145,11 +145,11 @@ Indexer::Private::handler(const std::string& fullpath, struct stat* statbuf, // lazy-mode); only for actual message dirs, since the dir // tstamps may not bubble up. dirstamp_ = store_.dirstamp(fullpath); - if (conf_.lazy_check && dirstamp_ >= statbuf->st_mtime && + if (conf_.lazy_check && dirstamp_ >= statbuf->st_ctime && htype == Scanner::HandleType::EnterNewCur) { g_debug("skip %s (seems up-to-date: %s >= %s)", fullpath.c_str(), time_to_string("%FT%T", dirstamp_).c_str(), - time_to_string("%FT%T", statbuf->st_mtime).c_str()); + time_to_string("%FT%T", statbuf->st_ctime).c_str()); return false; } @@ -189,7 +189,7 @@ Indexer::Private::handler(const std::string& fullpath, struct stat* statbuf, // if the message is not in the db yet, or not up-to-date, queue // it for updating/inserting. - if (statbuf->st_mtime <= dirstamp_ && store_.contains_message(fullpath)) { + if (statbuf->st_ctime <= dirstamp_ && store_.contains_message(fullpath)) { // g_debug ("skip %s: already up-to-date"); return false; }