From 9859e65d2fa229a5a95862630cfcbf3610b5ac39 Mon Sep 17 00:00:00 2001 From: Cong Chen Date: Sat, 1 Jul 2023 09:32:50 +0800 Subject: [PATCH] fix tests --- index-scheduler/src/lib.rs | 4 ++-- meilisearch/src/routes/metrics.rs | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/index-scheduler/src/lib.rs b/index-scheduler/src/lib.rs index 0594e15e0..a9affed0b 100644 --- a/index-scheduler/src/lib.rs +++ b/index-scheduler/src/lib.rs @@ -1815,12 +1815,12 @@ mod tests { #[test] fn test_task_is_processing() { - let (index_scheduler, mut handle) = IndexScheduler::test(true, vec![]); + let (index_scheduler, _handle) = IndexScheduler::test(true, vec![]); index_scheduler.register(index_creation_task("index_a", "id")).unwrap(); snapshot!(snapshot_index_scheduler(&index_scheduler), name: "registered_a_task"); - assert_eq!(index_scheduler.is_task_processing().unwrap(), true); + assert!(index_scheduler.is_task_processing().unwrap()); } /// We send a lot of tasks but notify the tasks scheduler only once as diff --git a/meilisearch/src/routes/metrics.rs b/meilisearch/src/routes/metrics.rs index d35778881..534c0c500 100644 --- a/meilisearch/src/routes/metrics.rs +++ b/meilisearch/src/routes/metrics.rs @@ -48,8 +48,7 @@ pub async fn get_metrics( } } - crate::metrics::MEILISEARCH_LAST_UPDATE - .set(response.last_update.unwrap().unix_timestamp()); + 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);