diff --git a/meilisearch-http/src/analytics.rs b/meilisearch-http/src/analytics.rs index 0c576a5a2..6626c84a5 100644 --- a/meilisearch-http/src/analytics.rs +++ b/meilisearch-http/src/analytics.rs @@ -55,6 +55,7 @@ fn write_user_id(db_path: &Path, user_id: &str) { mod segment { use crate::analytics::Analytics; use crate::routes::indexes::documents::UpdateDocumentsQuery; + use crate::Opt; use actix_web::http::header::USER_AGENT; use actix_web::HttpRequest; use http::header::CONTENT_TYPE; @@ -72,8 +73,6 @@ mod segment { use tokio::sync::Mutex; use uuid::Uuid; - use crate::Opt; - const SEGMENT_API_KEY: &str = "vHi89WrNDckHSQssyUJqLvIyp2QFITSC"; pub fn extract_user_agents(request: &HttpRequest) -> Vec { @@ -222,7 +221,8 @@ mod segment { } let _ = batcher.flush().await; } - tokio::time::sleep(Duration::from_secs(60 * 60)).await; // one hour + const INTERVAL: Duration = Duration::from_secs(60 * 60); // one hour + tokio::time::sleep(INTERVAL).await; } }); }