let CONTROL msgs fail early

This commit is contained in:
Evan Feenstra
2023-07-03 16:20:38 -07:00
parent 47aa55792c
commit 18e6b7af4e

View File

@@ -164,7 +164,13 @@ fn pub_and_wait(
} else { } else {
// for a specific client // for a specific client
log::debug!("publishing to a specific client"); log::debug!("publishing to a specific client");
pub_timeout(&cid, &msg.topic, &msg.message, &msg_rx, link_tx) let res_opt = pub_timeout(&cid, &msg.topic, &msg.message, &msg_rx, link_tx);
// control topic should be able to fail early without retrying
if res_opt.is_none() && msg.topic == topics::CONTROL {
Some(ChannelReply::empty())
} else {
res_opt
}
} }
} else { } else {
log::debug!("publishing to all clients"); log::debug!("publishing to all clients");