Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Improve comment
Rūdolfs Ošiņš committed 2 months ago
commit 2bbb35b2f14b7e1df1f00e35b3a7c44ed9256af7
parent 7dd7063
1 file changed +3 -1
modified radicle-httpd/src/api/v1/node.rs
@@ -77,7 +77,9 @@ async fn node_handler(State(ctx): State<Context>) -> impl IntoResponse {
        .unwrap_or_default()
        .map(|node| node.agent);

-
    // Work around /node endpoint being slow to respond.
+
    // The call to `is_running` is a blocking call, which has been, anecdotally, slow to respond.
+
    // Spawn a thread with a timeout to ensure that the call to `is_running` does not slow down the
+
    // response of the `/node` route too much.
    let node_state = {
        let socket = ctx.profile.socket();
        let is_running = timeout(