Skip to content

Commit f4ec414

Browse files
committed
retry fmt
1 parent 190e645 commit f4ec414

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

crates/calibrator/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ impl Calibrator for SinglePassCalibrator {
9090
//
9191
// The model is based on the following formula:
9292
//
93-
// bidPricePerPGU = (costPerHour / averageUtilizationRate) * (1 + profitMargin) / maxThroughputPerHour
93+
// bidPricePerPGU = (costPerHour / averageUtilizationRate) * (1 + profitMargin) /
94+
// maxThroughputPerHour
9495
let pgus_per_hour = pgus_per_second * 3600.0;
9596
let utilized_pgus_per_hour = pgus_per_hour * self.utilization_rate;
9697
let optimal_pgu_price = self.cost_per_hour / utilized_pgus_per_hour;

crates/rpc/src/retry.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ where
5555
// Check for tonic status errors.
5656
if let Some(status) = e.downcast_ref::<tonic::Status>() {
5757
match status.code() {
58-
Code::Unavailable
59-
| Code::DeadlineExceeded
60-
| Code::Internal
61-
| Code::Aborted => {
58+
Code::Unavailable |
59+
Code::DeadlineExceeded |
60+
Code::Internal |
61+
Code::Aborted => {
6262
warn!(
6363
"Network temporarily unavailable when {} due to {}, retrying...",
6464
operation_name,
@@ -83,14 +83,14 @@ where
8383
} else {
8484
// Check for common transport errors.
8585
let error_msg = e.to_string().to_lowercase();
86-
let is_transient = error_msg.contains("tls handshake")
87-
|| error_msg.contains("dns error")
88-
|| error_msg.contains("connection reset")
89-
|| error_msg.contains("broken pipe")
90-
|| error_msg.contains("transport error")
91-
|| error_msg.contains("failed to lookup")
92-
|| error_msg.contains("timeout")
93-
|| error_msg.contains("deadline exceeded");
86+
let is_transient = error_msg.contains("tls handshake") ||
87+
error_msg.contains("dns error") ||
88+
error_msg.contains("connection reset") ||
89+
error_msg.contains("broken pipe") ||
90+
error_msg.contains("transport error") ||
91+
error_msg.contains("failed to lookup") ||
92+
error_msg.contains("timeout") ||
93+
error_msg.contains("deadline exceeded");
9494

9595
if is_transient {
9696
warn!(

0 commit comments

Comments
 (0)