aboutsummaryrefslogtreecommitdiff
path: root/src/membership.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-19 17:15:48 +0200
committerAlex Auvolat <alex@adnab.me>2020-04-19 17:15:48 +0200
commita6129d8626f5b87462b70eadbce2db08c9761cfd (patch)
tree7e0e0d348bc8f8672db57680f8aeedf9c6c03523 /src/membership.rs
parent302502f4c10b4c1cd03d3b098b3e55a3f70054f2 (diff)
downloadgarage-a6129d8626f5b87462b70eadbce2db08c9761cfd.tar.gz
garage-a6129d8626f5b87462b70eadbce2db08c9761cfd.zip
Begin implement bucket management & admin commands
Diffstat (limited to 'src/membership.rs')
-rw-r--r--src/membership.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/membership.rs b/src/membership.rs
index 08dd5f2f..99b0388d 100644
--- a/src/membership.rs
+++ b/src/membership.rs
@@ -27,6 +27,8 @@ const PING_INTERVAL: Duration = Duration::from_secs(10);
const PING_TIMEOUT: Duration = Duration::from_secs(2);
const MAX_FAILED_PINGS: usize = 3;
+pub const MEMBERSHIP_RPC_PATH: &str = "_membership";
+
#[derive(Debug, Serialize, Deserialize)]
pub enum Message {
Ok,
@@ -277,9 +279,9 @@ impl System {
let rpc_http_client =
Arc::new(RpcHttpClient::new(&config.rpc_tls).expect("Could not create RPC client"));
- let rpc_path = "_membership";
+ let rpc_path = MEMBERSHIP_RPC_PATH.to_string();
let rpc_client = RpcClient::new(
- RpcAddrClient::<Message>::new(rpc_http_client.clone(), rpc_path.into()),
+ RpcAddrClient::<Message>::new(rpc_http_client.clone(), rpc_path.clone()),
background.clone(),
status.clone(),
);
@@ -294,7 +296,7 @@ impl System {
update_lock: Mutex::new((update_status, update_ring)),
background,
});
- sys.clone().register_handler(rpc_server, rpc_path.into());
+ sys.clone().register_handler(rpc_server, rpc_path);
sys
}
@@ -310,7 +312,7 @@ impl System {
Message::AdvertiseNodesUp(adv) => self2.handle_advertise_nodes_up(&adv).await,
Message::AdvertiseConfig(adv) => self2.handle_advertise_config(&adv).await,
- _ => Err(Error::Message(format!("Unexpected RPC message"))),
+ _ => Err(Error::BadRequest(format!("Unexpected RPC message"))),
}
}
});