mirror of
https://github.com/alphaXiv/OpenResearch.git
synced 2026-10-02 01:34:34 +08:00
Track remote gateway work before auto-restart
This commit is contained in:
+1
-1
@@ -4318,7 +4318,7 @@ impl Drop for Active {
|
||||
}
|
||||
}
|
||||
|
||||
async fn track_active(request: axum::extract::Request, next: Next) -> Response {
|
||||
pub(crate) async fn track_active(request: axum::extract::Request, next: Next) -> Response {
|
||||
// The dashboard holds its event stream open for as long as it is open.
|
||||
if request.uri().path() == "/api/events" {
|
||||
return next.run(request).await;
|
||||
|
||||
@@ -1124,6 +1124,7 @@ fn gateway_router(session: Arc<RemoteSession>) -> Router {
|
||||
)
|
||||
.fallback(gateway_fallback)
|
||||
.layer(DefaultBodyLimit::max(64 * 1024 * 1024))
|
||||
.layer(middleware::from_fn(super::up::track_active))
|
||||
.layer(middleware::from_fn(gateway_loopback_guard))
|
||||
.with_state(session)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user