mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
Yield the BBQueue writer instead of spin looping
This commit is contained in:
parent
54341c2e80
commit
261d2ceb06
1 changed files with 5 additions and 0 deletions
|
@ -661,6 +661,11 @@ where
|
||||||
if sender.is_disconnected() {
|
if sender.is_disconnected() {
|
||||||
return Err(Error::InternalError(InternalError::AbortedIndexation));
|
return Err(Error::InternalError(InternalError::AbortedIndexation));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We prefer to yield and allow the writing thread
|
||||||
|
// to do its job, especially beneficial when there
|
||||||
|
// is only one CPU core available.
|
||||||
|
std::thread::yield_now();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue