diff options
author | Alex Auvolat <alex@adnab.me> | 2020-04-11 23:53:32 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-04-11 23:53:32 +0200 |
commit | 9c931f5edacbaaab746ecf180fac2dd7062d0336 (patch) | |
tree | f29cfd82f573ac871408256a33e11f9153bae1da /src/rpc_client.rs | |
parent | 5dd59e437d5af84dfa2cf5dcc2c15807b971002d (diff) | |
download | garage-9c931f5edacbaaab746ecf180fac2dd7062d0336.tar.gz garage-9c931f5edacbaaab746ecf180fac2dd7062d0336.zip |
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
Diffstat (limited to 'src/rpc_client.rs')
-rw-r--r-- | src/rpc_client.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc_client.rs b/src/rpc_client.rs index 7587782e..8d8b724b 100644 --- a/src/rpc_client.rs +++ b/src/rpc_client.rs @@ -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"))), } |