mirror of https://github.com/djcb/mu.git
indexer: don't wait when indexing does not progress
Should help for #2233.
This commit is contained in:
parent
a1c430908a
commit
db1a5c8dd2
|
@ -276,12 +276,18 @@ Indexer::Private::start(const Indexer::Config& conf)
|
||||||
fq_.size());
|
fq_.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// now there may still be messages in the work queue...
|
// now there may still be messages in the work queue...
|
||||||
// finish those; this is a bit ugly; perhaps we should
|
// finish those; it's possible that the thread has already
|
||||||
// handle SIGTERM etc.
|
// stopped, so stop when there's no progress. A bit ugly, fixed
|
||||||
while (!fq_.empty())
|
// in >= 1.7
|
||||||
std::this_thread::sleep_for(100ms);
|
{
|
||||||
|
while (!fq_.empty()) {
|
||||||
|
const auto n = fq_.size();
|
||||||
|
std::this_thread::sleep_for(250ms);
|
||||||
|
if (fq_.size() >= n)
|
||||||
|
break; // no progress.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (conf_.cleanup) {
|
if (conf_.cleanup) {
|
||||||
g_debug ("starting cleanup");
|
g_debug ("starting cleanup");
|
||||||
|
|
Loading…
Reference in New Issue