mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-07 12:04:30 +01:00
Yield the BBQueue writer instead of spin looping
This commit is contained in:
parent
54341c2e80
commit
261d2ceb06
@ -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…
x
Reference in New Issue
Block a user