From ba69ad672a5adc9ca67c9e2c9a6a7ea5262c3cc6 Mon Sep 17 00:00:00 2001 From: Tamo Date: Thu, 28 Oct 2021 16:47:56 +0200 Subject: [PATCH] fix the timing issue --- meilisearch-http/src/analytics/segment_analytics.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/meilisearch-http/src/analytics/segment_analytics.rs b/meilisearch-http/src/analytics/segment_analytics.rs index f962fe6b9..9933a5deb 100644 --- a/meilisearch-http/src/analytics/segment_analytics.rs +++ b/meilisearch-http/src/analytics/segment_analytics.rs @@ -214,13 +214,12 @@ impl Segment { } async fn run(mut self, meilisearch: MeiliSearch) { - println!("CALLED"); const INTERVAL: Duration = Duration::from_secs(60 * 60); // one hour + let mut interval = tokio::time::interval(INTERVAL); + loop { - let mut interval = tokio::time::interval(INTERVAL); select! { _ = interval.tick() => { - println!("TRIGGERED"); self.tick(meilisearch.clone()).await; }, msg = self.inbox.recv() => { @@ -238,7 +237,6 @@ impl Segment { } async fn tick(&mut self, meilisearch: MeiliSearch) { - println!("SENDING A TICK"); if let Ok(stats) = meilisearch.get_all_stats().await { let _ = self .batcher