Add a message when log channel is lagged

This commit is contained in:
Igor Katson 2023-12-09 14:03:42 +00:00
parent 1331145333
commit 37f295cb95
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
5 changed files with 18 additions and 7 deletions

View file

@ -3,13 +3,14 @@ use axum::body::Bytes;
use axum::extract::{Path, Query, State};
use axum::response::IntoResponse;
use axum::routing::{get, post};
use futures::TryStreamExt;
use itertools::Itertools;
use serde::{Deserialize, Serialize};
use std::net::SocketAddr;
use std::str::FromStr;
use std::time::Duration;
use tracing::{info, warn};
use tracing::{debug, info, warn};
use axum::Router;
@ -187,7 +188,10 @@ impl HttpApi {
}
async fn stream_logs(State(state): State<ApiState>) -> Result<impl IntoResponse> {
let s = state.api_log_lines_stream()?;
let s = state.api_log_lines_stream()?.map_err(|e| {
debug!(error=%e, "stream_logs");
e
});
Ok(axum::body::Body::from_stream(s))
}