Skip to content

Commit

Permalink
ignore all errors by default
Browse files Browse the repository at this point in the history
  • Loading branch information
programatik29 committed Sep 5, 2021
1 parent 15625b9 commit 8e46548
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/proto/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ where
let start = Instant::now();
let counter = Arc::new(AtomicUsize::new(0));

let mut connection = self.connect_retry(start, self.time_for, &counter).await?;
let mut connection = match self.connect_retry(start, self.time_for, &counter).await {
Ok(conn) => conn,
Err(_) => {
return Ok(WorkerResult::default());
}
};

let mut times: Vec<Duration> = Vec::with_capacity(self.predicted_size);

Expand All @@ -75,7 +80,11 @@ where
}
},
_ = (&mut connection.handle) => {
connection = self.connect_retry(start, self.time_for, &counter).await?;
match self.connect_retry(start, self.time_for, &counter).await {
Ok(conn) => connection = conn,
// Errors are ignored currently.
Err(_) => break,
}
}
};
}
Expand Down
1 change: 1 addition & 0 deletions src/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fn get_percentile(request_times: &Vec<Duration>, pct: f64) -> Duration {
}

/// Contains and handles results from the workers
#[derive(Default)]
pub struct WorkerResult {
/// The total time taken for each worker.
pub total_times: Vec<Duration>,
Expand Down

0 comments on commit 8e46548

Please sign in to comment.