From cfc118704880453d29bcbe4fbbd91dda501cf5fe Mon Sep 17 00:00:00 2001 From: erikkaum Date: Tue, 16 Jul 2024 16:03:41 +0200 Subject: [PATCH] fix errors --- router/src/main.rs | 4 ++-- router/src/usage_stats.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/router/src/main.rs b/router/src/main.rs index ee02d676..13699f61 100644 --- a/router/src/main.rs +++ b/router/src/main.rs @@ -382,8 +382,8 @@ async fn main() -> Result<(), RouterError> { } }; - // Only send usage stats when TGI is run in container - let is_container = usage_stats::is_container(); + // Only send usage stats when TGI is run in container and the function returns Some + let is_container = matches!(usage_stats::is_container(), Ok(true)); let user_agent = if !disable_usage_stats && is_container { let reduced_args = usage_stats::Args::new( diff --git a/router/src/usage_stats.rs b/router/src/usage_stats.rs index 1471ca81..20aeb765 100644 --- a/router/src/usage_stats.rs +++ b/router/src/usage_stats.rs @@ -1,7 +1,7 @@ use crate::config::Config; use reqwest::header::HeaderMap; use serde::Serialize; -use std::{fmt, process::Command, time::Duration}; +use std::{fs::File, io::{self, BufRead}, path::Path, process::Command, time::Duration}; use uuid::Uuid; use csv::ReaderBuilder;