Skip to content

Commit

Permalink
refactor: Rename function to metadata_request_with_retry
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Jan 19, 2022
1 parent 18f62fc commit 553460a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ impl BrokerConnector {
allow_auto_topic_creation: None,
};

let response = metadata_request_loop(broker_override, &request, backoff, self).await?;
let response =
metadata_request_with_retry(broker_override, &request, backoff, self).await?;

// Since the metadata request contains information about the cluster state, use it to update our view.
self.topology.update(&response.brokers);
Expand Down Expand Up @@ -236,7 +237,7 @@ impl ArbitraryBrokerCache for &BrokerConnector {
}
}

async fn metadata_request_loop<A>(
async fn metadata_request_with_retry<A>(
broker_override: Option<Arc<A::C>>,
request_params: &MetadataRequest,
mut backoff: Backoff,
Expand Down Expand Up @@ -336,7 +337,7 @@ mod tests {
invalidate: Box::new(|| {}),
};

let result = metadata_request_loop(
let result = metadata_request_with_retry(
None,
&metadata_request,
Backoff::new(&Default::default()),
Expand All @@ -357,7 +358,7 @@ mod tests {
invalidate: Box::new(|| {}),
};

let result = metadata_request_loop(
let result = metadata_request_with_retry(
None,
&metadata_request,
Backoff::new(&Default::default()),
Expand Down Expand Up @@ -398,7 +399,7 @@ mod tests {
}),
};

let result = metadata_request_loop(
let result = metadata_request_with_retry(
None,
&metadata_request,
Backoff::new(&Default::default()),
Expand All @@ -421,7 +422,7 @@ mod tests {
invalidate: Box::new(|| unreachable!()),
};

let result = metadata_request_loop(
let result = metadata_request_with_retry(
broker_override,
&metadata_request,
Backoff::new(&Default::default()),
Expand All @@ -443,7 +444,7 @@ mod tests {
invalidate: Box::new(|| unreachable!()),
};

let result = metadata_request_loop(
let result = metadata_request_with_retry(
broker_override,
&metadata_request,
Backoff::new(&Default::default()),
Expand Down

0 comments on commit 553460a

Please sign in to comment.