mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-22 02:36:38 +00:00
Keep network status & ring in a tokio::sync::watch
advantages - reads don't prevent preparing writes - can be followed from other parts of the system by cloning the receiver
This commit is contained in:
+2
-2
@@ -79,8 +79,8 @@ pub async fn rpc_call(
|
||||
timeout: Duration,
|
||||
) -> Result<Message, Error> {
|
||||
let addr = {
|
||||
let members = sys.members.read().await;
|
||||
match members.status.get(to) {
|
||||
let status = sys.status.borrow().clone();
|
||||
match status.nodes.get(to) {
|
||||
Some(status) => status.addr.clone(),
|
||||
None => return Err(Error::Message(format!("Peer ID not found"))),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user