Skip to content

Commit ec3cac9

Browse files
committed
Merge #1500: Overhaul stats: Improve torrent-repository package before adding events (part 2)
4d91738 refactor: [#1495] renamings in torrent-repository pkg (Jose Celano) 5b3142f refactor: [#1495] refactor Swarms::upsert_peer (Jose Celano) 5c2c1e0 feat: [#1495] add len and is_empty methods to Swarms type (Jose Celano) 31f1fbf refactgor: [#1495] make field private (Jose Celano) 6d50fa0 refactor: [#1495] remove panics from Swarms type (Jose Celano) 5413e59 refactor: [#1495] renamings to follow latest changes in torrent-repository pkg (Jose Celano) 6f5cb27 refactor: [#1495] remove test for SwarmHandle (Jose Celano) Pull request description: Improve `torrent-repository` package before adding events. This is a continuation of [tracker/issues/1495](#1497). #### Refactoring `TorrentRepository` - [x] Return errors instead of panicking in `Swarms` type. - [x] Make field `swarms` private. - [x] Add `len` and `is_empty` methods. - [x] Refactor `upsert_peer`. - [x] Renamings to follow the latest changes in type names. ACKs for top commit: josecelano: ACK 4d91738 Tree-SHA512: 4ee9be1c21a62148d0d4fa0a9263c54312239fc98e2540d7583689a50126883ba563b5c676a606196c5696b14a4452a14061159b3ac2c69dd02c493c7930ceaf
2 parents c68570c + 4d91738 commit ec3cac9

File tree

10 files changed

+390
-374
lines changed

10 files changed

+390
-374
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/torrent-repository/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ version.workspace = true
1919
aquatic_udp_protocol = "0"
2020
bittorrent-primitives = "0.1.0"
2121
crossbeam-skiplist = "0"
22+
thiserror = "2.0.12"
2223
tokio = { version = "1", features = ["macros", "net", "rt-multi-thread", "signal", "sync"] }
2324
torrust-tracker-clock = { version = "3.0.0-develop", path = "../clock" }
2425
torrust-tracker-configuration = { version = "3.0.0-develop", path = "../configuration" }
2526
torrust-tracker-primitives = { version = "3.0.0-develop", path = "../primitives" }
26-
tracing = "0"
2727

2828
[dev-dependencies]
2929
async-std = { version = "1", features = ["attributes", "tokio1"] }

packages/torrent-repository/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub trait LockTrackedTorrent {
2323
fn lock_or_panic(&self) -> MutexGuard<'_, Swarm>;
2424
}
2525

26-
impl LockTrackedTorrent for Arc<Mutex<Swarm>> {
26+
impl LockTrackedTorrent for SwarmHandle {
2727
fn lock_or_panic(&self) -> MutexGuard<'_, Swarm> {
2828
self.lock().expect("can't acquire lock for tracked torrent handle")
2929
}

0 commit comments

Comments
 (0)