mu-index: make progress a bit smoother

Avoid the lock
This commit is contained in:
Dirk-Jan C. Binnema 2020-10-13 23:36:19 +03:00
parent 9bf32e720b
commit 38b5c25762
1 changed files with 5 additions and 4 deletions

View File

@ -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";