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
2 changes: 1 addition & 1 deletion .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
cargo publish -p torrust-tracker-located-error
cargo publish -p torrust-tracker-metrics
cargo publish -p torrust-tracker-primitives
cargo publish -p torrust-tracker-swarm-coordination-registry
cargo publish -p torrust-tracker-test-helpers
cargo publish -p torrust-tracker-torrent-benchmarking
cargo publish -p torrust-tracker-torrent-repository
cargo publish -p torrust-udp-tracker-server
40 changes: 20 additions & 20 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ torrust-rest-tracker-api-core = { version = "3.0.0-develop", path = "packages/re
torrust-server-lib = { version = "3.0.0-develop", path = "packages/server-lib" }
torrust-tracker-clock = { version = "3.0.0-develop", path = "packages/clock" }
torrust-tracker-configuration = { version = "3.0.0-develop", path = "packages/configuration" }
torrust-tracker-torrent-repository = { version = "3.0.0-develop", path = "packages/torrent-repository" }
torrust-tracker-swarm-coordination-registry = { version = "3.0.0-develop", path = "packages/swarm-coordination-registry" }
torrust-udp-tracker-server = { version = "3.0.0-develop", path = "packages/udp-tracker-server" }
tracing = "0"
tracing-subscriber = { version = "0", features = ["json"] }
Expand Down
2 changes: 1 addition & 1 deletion packages/axum-http-tracker-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ torrust-server-lib = { version = "3.0.0-develop", path = "../server-lib" }
torrust-tracker-clock = { version = "3.0.0-develop", path = "../clock" }
torrust-tracker-configuration = { version = "3.0.0-develop", path = "../configuration" }
torrust-tracker-primitives = { version = "3.0.0-develop", path = "../primitives" }
torrust-tracker-torrent-repository = { version = "3.0.0-develop", path = "../torrent-repository" }
torrust-tracker-swarm-coordination-registry = { version = "3.0.0-develop", path = "../swarm-coordination-registry" }
tower = { version = "0", features = ["timeout"] }
tower-http = { version = "0", features = ["compression-full", "cors", "propagate-header", "request-id", "trace"] }
tracing = "0"
Expand Down
2 changes: 1 addition & 1 deletion packages/axum-http-tracker-server/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use torrust_axum_server::tsl::make_rust_tls;
use torrust_server_lib::registar::Registar;
use torrust_tracker_configuration::{logging, Configuration};
use torrust_tracker_primitives::peer;
use torrust_tracker_torrent_repository::container::TorrentRepositoryContainer;
use torrust_tracker_swarm_coordination_registry::container::TorrentRepositoryContainer;

use crate::server::{HttpServer, Launcher, Running, Stopped};

Expand Down
2 changes: 1 addition & 1 deletion packages/axum-http-tracker-server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ mod tests {
use torrust_axum_server::tsl::make_rust_tls;
use torrust_server_lib::registar::Registar;
use torrust_tracker_configuration::{logging, Configuration};
use torrust_tracker_swarm_coordination_registry::container::TorrentRepositoryContainer;
use torrust_tracker_test_helpers::configuration::ephemeral_public;
use torrust_tracker_torrent_repository::container::TorrentRepositoryContainer;

use crate::server::{HttpServer, Launcher};

Expand Down
2 changes: 1 addition & 1 deletion packages/axum-rest-tracker-api-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ torrust-tracker-clock = { version = "3.0.0-develop", path = "../clock" }
torrust-tracker-configuration = { version = "3.0.0-develop", path = "../configuration" }
torrust-tracker-metrics = { version = "3.0.0-develop", path = "../metrics" }
torrust-tracker-primitives = { version = "3.0.0-develop", path = "../primitives" }
torrust-tracker-torrent-repository = { version = "3.0.0-develop", path = "../torrent-repository" }
torrust-tracker-swarm-coordination-registry = { version = "3.0.0-develop", path = "../swarm-coordination-registry" }
torrust-udp-tracker-server = { version = "3.0.0-develop", path = "../udp-tracker-server" }
tower = { version = "0", features = ["timeout"] }
tower-http = { version = "0", features = ["compression-full", "cors", "propagate-header", "request-id", "trace"] }
Expand Down
2 changes: 1 addition & 1 deletion packages/axum-rest-tracker-api-server/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use torrust_rest_tracker_api_core::container::TrackerHttpApiCoreContainer;
use torrust_server_lib::registar::Registar;
use torrust_tracker_configuration::{logging, Configuration};
use torrust_tracker_primitives::peer;
use torrust_tracker_torrent_repository::container::TorrentRepositoryContainer;
use torrust_tracker_swarm_coordination_registry::container::TorrentRepositoryContainer;
use torrust_udp_tracker_server::container::UdpTrackerServerContainer;

use crate::server::{ApiServer, Launcher, Running, Stopped};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub async fn get_metrics_handler(
State(state): State<(
Arc<InMemoryTorrentRepository>,
Arc<RwLock<BanService>>,
Arc<torrust_tracker_torrent_repository::statistics::repository::Repository>,
Arc<torrust_tracker_swarm_coordination_registry::statistics::repository::Repository>,
Arc<bittorrent_tracker_core::statistics::repository::Repository>,
Arc<bittorrent_http_tracker_core::statistics::repository::Repository>,
Arc<bittorrent_udp_tracker_core::statistics::repository::Repository>,
Expand Down
2 changes: 1 addition & 1 deletion packages/http-tracker-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ torrust-tracker-configuration = { version = "3.0.0-develop", path = "../configur
torrust-tracker-events = { version = "3.0.0-develop", path = "../events" }
torrust-tracker-metrics = { version = "3.0.0-develop", path = "../metrics" }
torrust-tracker-primitives = { version = "3.0.0-develop", path = "../primitives" }
torrust-tracker-torrent-repository = { version = "3.0.0-develop", path = "../torrent-repository" }
torrust-tracker-swarm-coordination-registry = { version = "3.0.0-develop", path = "../swarm-coordination-registry" }
tracing = "0"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion packages/http-tracker-core/src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::Arc;

use bittorrent_tracker_core::container::TrackerCoreContainer;
use torrust_tracker_configuration::{Core, HttpTracker};
use torrust_tracker_torrent_repository::container::TorrentRepositoryContainer;
use torrust_tracker_swarm_coordination_registry::container::TorrentRepositoryContainer;

use crate::event::bus::EventBus;
use crate::event::sender::Broadcaster;
Expand Down
2 changes: 1 addition & 1 deletion packages/rest-tracker-api-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tokio = { version = "1", features = ["macros", "net", "rt-multi-thread", "signal
torrust-tracker-configuration = { version = "3.0.0-develop", path = "../configuration" }
torrust-tracker-metrics = { version = "3.0.0-develop", path = "../metrics" }
torrust-tracker-primitives = { version = "3.0.0-develop", path = "../primitives" }
torrust-tracker-torrent-repository = { version = "3.0.0-develop", path = "../torrent-repository" }
torrust-tracker-swarm-coordination-registry = { version = "3.0.0-develop", path = "../swarm-coordination-registry" }
torrust-udp-tracker-server = { version = "3.0.0-develop", path = "../udp-tracker-server" }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion packages/rest-tracker-api-core/src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bittorrent_udp_tracker_core::services::banning::BanService;
use bittorrent_udp_tracker_core::{self};
use tokio::sync::RwLock;
use torrust_tracker_configuration::{Core, HttpApi, HttpTracker, UdpTracker};
use torrust_tracker_torrent_repository::container::TorrentRepositoryContainer;
use torrust_tracker_swarm_coordination_registry::container::TorrentRepositoryContainer;
use torrust_udp_tracker_server::container::UdpTrackerServerContainer;

pub struct TrackerHttpApiCoreContainer {
Expand Down
4 changes: 2 additions & 2 deletions packages/rest-tracker-api-core/src/statistics/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub struct TrackerLabeledMetrics {
pub async fn get_labeled_metrics(
in_memory_torrent_repository: Arc<InMemoryTorrentRepository>,
ban_service: Arc<RwLock<BanService>>,
swarms_stats_repository: Arc<torrust_tracker_torrent_repository::statistics::repository::Repository>,
swarms_stats_repository: Arc<torrust_tracker_swarm_coordination_registry::statistics::repository::Repository>,
tracker_core_stats_repository: Arc<bittorrent_tracker_core::statistics::repository::Repository>,
http_stats_repository: Arc<bittorrent_http_tracker_core::statistics::repository::Repository>,
udp_stats_repository: Arc<bittorrent_udp_tracker_core::statistics::repository::Repository>,
Expand Down Expand Up @@ -165,8 +165,8 @@ mod tests {
use tokio::sync::RwLock;
use torrust_tracker_configuration::Configuration;
use torrust_tracker_events::bus::SenderStatus;
use torrust_tracker_swarm_coordination_registry::container::TorrentRepositoryContainer;
use torrust_tracker_test_helpers::configuration;
use torrust_tracker_torrent_repository::container::TorrentRepositoryContainer;

use crate::statistics::metrics::{ProtocolMetrics, TorrentsMetrics};
use crate::statistics::services::{get_metrics, TrackerMetrics};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
description = "A library that provides a repository of torrents files and their peers."
keywords = ["library", "repository", "torrents"]
name = "torrust-tracker-torrent-repository"
name = "torrust-tracker-swarm-coordination-registry"
readme = "README.md"

authors.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use crate::event::bus::EventBus;
use crate::event::sender::Broadcaster;
use crate::event::{self};
use crate::statistics::repository::Repository;
use crate::{statistics, Swarms};
use crate::{statistics, Registry};

pub struct TorrentRepositoryContainer {
pub swarms: Arc<Swarms>,
pub swarms: Arc<Registry>,
pub event_bus: Arc<event::bus::EventBus>,
pub stats_event_sender: event::sender::Sender,
pub stats_repository: Arc<statistics::repository::Repository>,
Expand All @@ -26,7 +26,7 @@ impl TorrentRepositoryContainer {

let stats_event_sender = event_bus.sender();

let swarms = Arc::new(Swarms::new(stats_event_sender.clone()));
let swarms = Arc::new(Registry::new(stats_event_sender.clone()));

Self {
swarms,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ pub mod container;
pub mod event;
pub mod statistics;
pub mod swarm;
pub mod swarms;

use std::sync::Arc;

use tokio::sync::Mutex;
use torrust_tracker_clock::clock;

pub type Swarms = swarms::Swarms;
pub type SwarmHandle = Arc<Mutex<Swarm>>;
pub type Swarm = swarm::Swarm;
pub type Registry = swarm::registry::Registry;
pub type CoordinatorHandle = Arc<Mutex<Coordinator>>;
pub type Coordinator = swarm::coordinator::Coordinator;

/// Working version, for production.
#[cfg(not(test))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ use tracing::instrument;

use super::repository::Repository;
use crate::statistics::{TORRENT_REPOSITORY_PEERS_INACTIVE_TOTAL, TORRENT_REPOSITORY_TORRENTS_INACTIVE_TOTAL};
use crate::{CurrentClock, Swarms};
use crate::{CurrentClock, Registry};

#[must_use]
#[instrument(skip(swarms, stats_repository))]
pub fn start_job(
swarms: &Arc<Swarms>,
swarms: &Arc<Registry>,
stats_repository: &Arc<Repository>,
inactivity_cutoff: DurationSinceUnixEpoch,
) -> JoinHandle<()> {
Expand Down Expand Up @@ -51,7 +51,7 @@ pub fn start_job(

async fn update_activity_metrics(
interval_in_secs: u64,
swarms: &Arc<Swarms>,
swarms: &Arc<Registry>,
stats_repository: &Arc<Repository>,
inactivity_cutoff: DurationSinceUnixEpoch,
) {
Expand Down
Loading