Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ strip = true
anyhow = { version = "1.0", features = ["backtrace"] }
ar = "0.9"
async-trait = "0.1"
backon = { version = "1", default-features = false, features = [
"std-blocking-sleep",
] }
base64 = "0.21"
bincode = "1"
blake3 = "1"
Expand Down Expand Up @@ -78,7 +81,6 @@ reqwest = { version = "0.12", features = [
"rustls-tls-native-roots",
"trust-dns",
], optional = true }
retry = "2"
semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
7 changes: 5 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use crate::errors::*;
use crate::net::Connection;
use crate::protocol::{Request, Response};
use crate::util;
use backon::BlockingRetryable;
use byteorder::{BigEndian, ByteOrder};
use retry::{delay::Fixed, retry};
use std::io::{self, BufReader, BufWriter, Read};

/// A connection to an sccache server.
Expand Down Expand Up @@ -79,7 +79,10 @@ pub fn connect_with_retry(addr: &crate::net::SocketAddr) -> io::Result<ServerCon
// if the process exited.
// * Send a pipe handle to the server process so it can notify
// us once it starts the server instead of us polling.
match retry(Fixed::from_millis(500).take(10), || connect_to_server(addr)) {
let backoff = backon::ConstantBuilder::default()
.with_delay(std::time::Duration::from_millis(500))
.with_max_times(10);
match (|| connect_to_server(addr)).retry(backoff).call() {
Ok(conn) => Ok(conn),
Err(e) => Err(io::Error::new(
io::ErrorKind::TimedOut,
Expand Down
Loading