Answer status to the client that asked, not everyone
status is a terminal event. Broadcast, the healthcheck's answer ended any ipx fetch that was watching a scan, which stopped reading at the next probe while the scan carried on. It could not happen while status waited behind the scan; answering it at once made it happen every 30 seconds. Each connection's writer now takes private replies beside the broadcast, and the test checks another client hears nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TAC7sLVqfKmY6rsTLXzNgk
This commit is contained in:
@@ -398,7 +398,7 @@ async fn daemon(
|
||||
// status is answered by the socket itself; everything else waits its turn in the queue.
|
||||
let answer: ipc::StatusFn = {
|
||||
let ctx = ctx.clone();
|
||||
Arc::new(move || ctx.out.emit(status(&ctx)))
|
||||
Arc::new(move || status(&ctx))
|
||||
};
|
||||
let server = tokio::spawn(ipc::serve(socket.clone(), events.clone(), tx_cmd, answer));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user