diff --git a/server/src/handlers/http/logstream.rs b/server/src/handlers/http/logstream.rs index 327b6fd98..89d5b4cdb 100644 --- a/server/src/handlers/http/logstream.rs +++ b/server/src/handlers/http/logstream.rs @@ -316,7 +316,6 @@ pub async fn get_stats(req: HttpRequest) -> Result ) } - // ? this case should not happen None => { let ingestion_stats = IngestionStats::new( stats.events, @@ -329,13 +328,14 @@ pub async fn get_stats(req: HttpRequest) -> Result QueriedStats::new( &stream_name, &stream_meta.created_at, - Some('0'.to_string()), + None, time, ingestion_stats, storage_stats, ) } }; + let stats = if let Some(mut ingestor_stats) = ingestor_stats { ingestor_stats.push(stats); QueryServer::merge_quried_stats(ingestor_stats) diff --git a/server/src/handlers/http/modal/query_server.rs b/server/src/handlers/http/modal/query_server.rs index 6eec4078b..6b8c8841a 100644 --- a/server/src/handlers/http/modal/query_server.rs +++ b/server/src/handlers/http/modal/query_server.rs @@ -572,6 +572,8 @@ impl QueryServer { let min_first_event_at = stats .iter() .map(|x| match x.first_event_at.as_ref() { + // we can directly unwrap here because we are sure + // that the string is a valid date time or is None Some(fea) => fea.parse::>().unwrap_or_default(), None => Utc::now(), })