From 38b5c257629d83c1a09c8f20caf3698fecd5aaf4 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 13 Oct 2020 23:36:19 +0300 Subject: [PATCH] mu-index: make progress a bit smoother Avoid the lock --- mu/mu-cmd-index.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mu/mu-cmd-index.cc b/mu/mu-cmd-index.cc index 68657360..f5bcaa66 100644 --- a/mu/mu-cmd-index.cc +++ b/mu/mu-cmd-index.cc @@ -120,12 +120,13 @@ mu_cmd_index (Mu::Store& store, const MuConfig *opts, GError **err) install_sig_handler (); - store.indexer().start(conf); - while (!CaughtSignal && store.indexer().is_running()) { + auto& indexer{store.indexer()}; + indexer.start(conf); + while (!CaughtSignal && indexer.is_running()) { if (!opts->quiet) - print_stats (store.indexer().progress(), !opts->nocolor); + print_stats (indexer.progress(), !opts->nocolor); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + std::this_thread::sleep_for(std::chrono::milliseconds(250)); if (!opts->quiet) { std::cout << "\r";