Reference self Node by host and optionally port, get rid of DType

This commit is contained in:
Dominik Werder
2021-05-01 11:31:10 +02:00
parent c4fa5dcc28
commit 0f9408e9f8
11 changed files with 44 additions and 64 deletions
+2 -3
View File
@@ -30,7 +30,7 @@ async fn go() -> Result<(), Error> {
let node_config: NodeConfig = serde_json::from_slice(&buf)?;
let node = node_config
.get_node()
.ok_or(Error::with_msg(format!("nodeid config error")))?;
.ok_or(Error::with_msg(format!("nodeid config error {:?}", node_config)))?;
retrieval::run_node(node_config.clone(), node.clone()).await?;
}
SubCmd::Client(client) => match client.client_type {
@@ -54,7 +54,6 @@ fn simple_fetch() {
taskrun::run(async {
let t1 = chrono::Utc::now();
let node = Node {
id: format!("{:02}", 0),
host: "localhost".into(),
listen: "0.0.0.0".into(),
port: 8360,
@@ -91,7 +90,7 @@ fn simple_fetch() {
},
};
let node_config = NodeConfig {
nodeid: cluster.nodes[0].id.clone(),
name: format!("{}:{}", cluster.nodes[0].host, cluster.nodes[0].port),
cluster,
};
let node = node_config.get_node().unwrap();
+1 -1
View File
@@ -14,7 +14,7 @@ pub fn spawn_test_hosts(cluster: Cluster) -> Vec<JoinHandle<Result<(), Error>>>
for node in &cluster.nodes {
let node_config = NodeConfig {
cluster: cluster.clone(),
nodeid: node.id.clone(),
name: format!("{}:{}", node.host, node.port),
};
let h = tokio::spawn(httpret::host(node_config, node.clone()));
ret.push(h);
-1
View File
@@ -15,7 +15,6 @@ fn test_cluster() -> Cluster {
let nodes = (0..3)
.into_iter()
.map(|id| Node {
id: format!("{:02}", id),
host: "localhost".into(),
listen: "0.0.0.0".into(),
port: 8360 + id as u16,