Fix ping timeout and interval #4

Merged
lx merged 8 commits from fix-ping into main 2022-09-02 12:22:57 +00:00
3 changed files with 267 additions and 245 deletions
Showing only changes of commit c865cc9f9c - Show all commits

496
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -22,21 +22,21 @@ telemetry = ["opentelemetry", "opentelemetry-contrib", "rand"]
[dependencies] [dependencies]
futures = "0.3.17" futures = "0.3.17"
tokio = { version = "1.0", default-features = false, features = ["net", "rt", "rt-multi-thread", "sync", "time", "macros", "io-util", "signal"] } tokio = { version = "1.0", default-features = false, features = ["net", "rt", "rt-multi-thread", "sync", "time", "macros", "io-util", "signal"] }
tokio-util = { version = "0.6.8", default-features = false, features = ["compat"] } tokio-util = { version = "0.7", default-features = false, features = ["compat"] }
tokio-stream = "0.1.7" tokio-stream = "0.1.7"
serde = { version = "1.0", default-features = false, features = ["derive"] } serde = { version = "1.0", default-features = false, features = ["derive"] }
rmp-serde = "0.14.3" rmp-serde = "0.15"
hex = "0.4.2" hex = "0.4.2"
rand = { version = "0.5.5", optional = true } rand = { version = "0.8", optional = true }
log = "0.4.8" log = "0.4.8"
arc-swap = "1.1" arc-swap = "1.1"
async-trait = "0.1.7" async-trait = "0.1.7"
err-derive = "0.2.3" err-derive = "0.3"
bytes = "0.6.0" bytes = "1.0"
lru = { version = "0.6", optional = true } lru = { version = "0.7", optional = true }
cfg-if = "1.0" cfg-if = "1.0"
sodiumoxide = { version = "0.2.5-0", package = "kuska-sodiumoxide" } sodiumoxide = { version = "0.2.5-0", package = "kuska-sodiumoxide" }
@ -46,7 +46,7 @@ opentelemetry = { version = "0.17", optional = true }
opentelemetry-contrib = { version = "0.9", optional = true } opentelemetry-contrib = { version = "0.9", optional = true }
[dev-dependencies] [dev-dependencies]
env_logger = "0.8" env_logger = "0.9"
structopt = { version = "0.3", default-features = false } structopt = { version = "0.3", default-features = false }
chrono = "0.4" chrono = "0.4"

View file

@ -138,7 +138,7 @@ impl BasaltView {
let mut ret = vec![]; let mut ret = vec![];
let mut rng = thread_rng(); let mut rng = thread_rng();
for _i in 0..count { for _i in 0..count {
let idx = rng.gen_range(0, possibles.len()); let idx = rng.gen_range(0..possibles.len());
ret.push(self.slots[possibles[idx]].peer.unwrap()); ret.push(self.slots[possibles[idx]].peer.unwrap());
} }
ret ret