mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
connect the search queue with the health route
This commit is contained in:
parent
03c886ac1b
commit
b7c582e4f3
2 changed files with 13 additions and 0 deletions
|
@ -117,4 +117,14 @@ impl SearchQueue {
|
|||
self.sender.send(sender).await.map_err(|_| MeilisearchHttpError::SearchLimiterIsDown)?;
|
||||
receiver.await.map_err(|_| MeilisearchHttpError::TooManySearchRequests(self.capacity))
|
||||
}
|
||||
|
||||
/// Returns `Ok(())` if everything seems normal.
|
||||
/// Returns `Err(MeilisearchHttpError::SearchLimiterIsDown)` if the search limiter seems down.
|
||||
pub fn health(&self) -> Result<(), MeilisearchHttpError> {
|
||||
if self.sender.is_closed() {
|
||||
Err(MeilisearchHttpError::SearchLimiterIsDown)
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue