fix(heal): ignore missing response subscribers (#3015)

* fix(heal): ignore missing response subscribers

* fix(heal): ignore missing response subscribers
This commit is contained in:
安正超
2026-05-19 23:34:22 +08:00
committed by GitHub
parent 1c8fdfddf4
commit 54be3cab23
+8 -1
View File
@@ -379,7 +379,9 @@ fn heal_response_sender() -> &'static HealResponseSender {
/// Publish a heal response to subscribers.
pub fn publish_heal_response(response: HealChannelResponse) -> Result<(), broadcast::error::SendError<HealChannelResponse>> {
heal_response_sender().send(response).map(|_| ())
let sender = heal_response_sender();
let _ = sender.send(response);
Ok(())
}
/// Subscribe to heal responses.
@@ -626,5 +628,10 @@ mod tests {
let received = receiver.recv().await.expect("should receive heal response");
assert_eq!(received.request_id, response.request_id);
assert!(received.success);
drop(receiver);
let response = create_heal_response("req-no-subscriber".to_string(), true, None, None);
publish_heal_response(response).expect("publish without subscribers should be ignored");
}
}