Add a message when log channel is lagged
This commit is contained in:
parent
1331145333
commit
37f295cb95
5 changed files with 18 additions and 7 deletions
5
Makefile
5
Makefile
|
|
@ -18,7 +18,10 @@ webui-build: webui-deps
|
|||
@PHONY: devserver
|
||||
devserver:
|
||||
echo -n '' > /tmp/rqbit-log
|
||||
CORS_DEBUG=1 cargo run --release -- --log-file /tmp/rqbit-log server start /tmp/scratch/
|
||||
CORS_DEBUG=1 cargo run --release -- \
|
||||
--log-file /tmp/rqbit-log \
|
||||
--log-file-rust-log=debug,librqbit=trace \
|
||||
server start /tmp/scratch/
|
||||
|
||||
@PHONY: clean
|
||||
clean:
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
|
|||
2
crates/librqbit/webui/dist/assets/index.js
vendored
2
crates/librqbit/webui/dist/assets/index.js
vendored
File diff suppressed because one or more lines are too long
2
crates/librqbit/webui/dist/manifest.json
vendored
2
crates/librqbit/webui/dist/manifest.json
vendored
|
|
@ -4,7 +4,7 @@
|
|||
"src": "assets/logo.svg"
|
||||
},
|
||||
"index.html": {
|
||||
"file": "assets/index-b804d1c8.js",
|
||||
"file": "assets/index-af1222d3.js",
|
||||
"isEntry": true,
|
||||
"src": "index.html"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ const streamLogs = (
|
|||
text,
|
||||
},
|
||||
});
|
||||
throw new Error("retry");
|
||||
throw null;
|
||||
}
|
||||
|
||||
if (!response.body) {
|
||||
|
|
@ -88,7 +88,7 @@ const streamLogs = (
|
|||
setError({
|
||||
text: "log stream terminated",
|
||||
});
|
||||
throw new Error("retry");
|
||||
throw null;
|
||||
}
|
||||
|
||||
buffer = mergeBuffers(buffer, value);
|
||||
|
|
@ -110,6 +110,10 @@ const streamLogs = (
|
|||
if (canceled) {
|
||||
return;
|
||||
}
|
||||
if (e === null) {
|
||||
// We already set the error.
|
||||
return;
|
||||
}
|
||||
setError({
|
||||
text: "error streaming logs",
|
||||
details: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue