mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Don't unwrap in case of error/missing last_update field
This commit is contained in:
parent
71500a4e15
commit
5387cf1718
2 changed files with 10 additions and 13 deletions
|
@ -48,9 +48,10 @@ pub async fn get_metrics(
|
|||
}
|
||||
}
|
||||
|
||||
crate::metrics::MEILISEARCH_LAST_UPDATE.set(response.last_update.unwrap().unix_timestamp());
|
||||
crate::metrics::MEILISEARCH_IS_INDEXING
|
||||
.set(index_scheduler.is_task_processing().unwrap() as i64);
|
||||
if let Some(last_update) = response.last_update {
|
||||
crate::metrics::MEILISEARCH_LAST_UPDATE.set(last_update.unix_timestamp());
|
||||
}
|
||||
crate::metrics::MEILISEARCH_IS_INDEXING.set(index_scheduler.is_task_processing()? as i64);
|
||||
|
||||
let encoder = TextEncoder::new();
|
||||
let mut buffer = vec![];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue