Skip to content

Commit 9ec5ed2

Browse files
committed
fix: fixed the max_peer_timeout, peers no longer get removed every peer_cleanup if they are within the max_peer_timeout
1 parent ff7c964 commit 9ec5ed2

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
edition = "2021"
33
name = "torrust-tracker"
4-
version = "2.3.0"
4+
version = "2.3.1"
55
license = "AGPL-3.0"
66
authors = ["Mick van Dijke <mick@dutchbits.nl>"]
77
description = "A feature rich BitTorrent tracker."
@@ -16,7 +16,6 @@ lto = "thin"
1616
debug = 1
1717
opt-level = 3
1818
lto = "fat"
19-
strip = true
2019

2120
[dependencies]
2221
tokio = { version = "1.7", features = ["full"] }

src/tracker/torrent.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl TorrentEntry {
7474

7575
pub fn remove_inactive_peers(&mut self, max_peer_timeout: u32) {
7676
self.peers.retain(|_, peer| {
77-
peer.updated.elapsed() > std::time::Duration::from_secs(max_peer_timeout as u64)
77+
peer.updated.elapsed() < std::time::Duration::from_secs(max_peer_timeout as u64)
7878
});
7979
}
8080
}

0 commit comments

Comments
 (0)