Skip to content

Commit 7e27d31

Browse files
committed
refactor: [#1541] move mod
1 parent fdbea0a commit 7e27d31

File tree

15 files changed

+15
-14
lines changed

15 files changed

+15
-14
lines changed

packages/axum-http-tracker-server/src/v1/handlers/announce.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ mod tests {
119119
use bittorrent_tracker_core::authentication::key::repository::in_memory::InMemoryKeyRepository;
120120
use bittorrent_tracker_core::authentication::service::AuthenticationService;
121121
use bittorrent_tracker_core::databases::setup::initialize_database;
122+
use bittorrent_tracker_core::statistics::persisted::downloads::DatabaseDownloadsMetricRepository;
122123
use bittorrent_tracker_core::torrent::repository::in_memory::InMemoryTorrentRepository;
123-
use bittorrent_tracker_core::torrent::repository::downloads::DatabaseDownloadsMetricRepository;
124124
use bittorrent_tracker_core::whitelist::authorization::WhitelistAuthorization;
125125
use bittorrent_tracker_core::whitelist::repository::in_memory::InMemoryWhitelist;
126126
use torrust_tracker_configuration::Configuration;

packages/http-tracker-core/benches/helpers/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use bittorrent_tracker_core::announce_handler::AnnounceHandler;
1414
use bittorrent_tracker_core::authentication::key::repository::in_memory::InMemoryKeyRepository;
1515
use bittorrent_tracker_core::authentication::service::AuthenticationService;
1616
use bittorrent_tracker_core::databases::setup::initialize_database;
17+
use bittorrent_tracker_core::statistics::persisted::downloads::DatabaseDownloadsMetricRepository;
1718
use bittorrent_tracker_core::torrent::repository::in_memory::InMemoryTorrentRepository;
18-
use bittorrent_tracker_core::torrent::repository::downloads::DatabaseDownloadsMetricRepository;
1919
use bittorrent_tracker_core::whitelist::authorization::WhitelistAuthorization;
2020
use bittorrent_tracker_core::whitelist::repository::in_memory::InMemoryWhitelist;
2121
use futures::future::BoxFuture;

packages/http-tracker-core/src/services/announce.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ mod tests {
212212
use bittorrent_tracker_core::authentication::key::repository::in_memory::InMemoryKeyRepository;
213213
use bittorrent_tracker_core::authentication::service::AuthenticationService;
214214
use bittorrent_tracker_core::databases::setup::initialize_database;
215+
use bittorrent_tracker_core::statistics::persisted::downloads::DatabaseDownloadsMetricRepository;
215216
use bittorrent_tracker_core::torrent::repository::in_memory::InMemoryTorrentRepository;
216-
use bittorrent_tracker_core::torrent::repository::downloads::DatabaseDownloadsMetricRepository;
217217
use bittorrent_tracker_core::whitelist::authorization::WhitelistAuthorization;
218218
use bittorrent_tracker_core::whitelist::repository::in_memory::InMemoryWhitelist;
219219
use torrust_tracker_configuration::{Configuration, Core};

packages/http-tracker-core/src/services/scrape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ mod tests {
176176
use bittorrent_tracker_core::authentication::service::AuthenticationService;
177177
use bittorrent_tracker_core::databases::setup::initialize_database;
178178
use bittorrent_tracker_core::scrape_handler::ScrapeHandler;
179+
use bittorrent_tracker_core::statistics::persisted::downloads::DatabaseDownloadsMetricRepository;
179180
use bittorrent_tracker_core::torrent::repository::in_memory::InMemoryTorrentRepository;
180-
use bittorrent_tracker_core::torrent::repository::downloads::DatabaseDownloadsMetricRepository;
181181
use bittorrent_tracker_core::whitelist::authorization::WhitelistAuthorization;
182182
use bittorrent_tracker_core::whitelist::repository::in_memory::InMemoryWhitelist;
183183
use futures::future::BoxFuture;

packages/tracker-core/src/announce_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ use torrust_tracker_primitives::core::AnnounceData;
9999
use torrust_tracker_primitives::peer;
100100

101101
use super::torrent::repository::in_memory::InMemoryTorrentRepository;
102-
use super::torrent::repository::downloads::DatabaseDownloadsMetricRepository;
103102
use crate::error::AnnounceError;
103+
use crate::statistics::persisted::downloads::DatabaseDownloadsMetricRepository;
104104
use crate::whitelist::authorization::WhitelistAuthorization;
105105

106106
/// Handles `announce` requests from `BitTorrent` clients.

packages/tracker-core/src/container.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ use crate::authentication::service::AuthenticationService;
1111
use crate::databases::setup::initialize_database;
1212
use crate::databases::Database;
1313
use crate::scrape_handler::ScrapeHandler;
14+
use crate::statistics::persisted::downloads::DatabaseDownloadsMetricRepository;
1415
use crate::torrent::manager::TorrentsManager;
1516
use crate::torrent::repository::in_memory::InMemoryTorrentRepository;
16-
use crate::torrent::repository::downloads::DatabaseDownloadsMetricRepository;
1717
use crate::whitelist::authorization::WhitelistAuthorization;
1818
use crate::whitelist::manager::WhitelistManager;
1919
use crate::whitelist::repository::in_memory::InMemoryWhitelist;

packages/tracker-core/src/statistics/event/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use torrust_tracker_metrics::metric_name;
55
use torrust_tracker_primitives::DurationSinceUnixEpoch;
66
use torrust_tracker_torrent_repository::event::Event;
77

8+
use crate::statistics::persisted::downloads::DatabaseDownloadsMetricRepository;
89
use crate::statistics::repository::Repository;
910
use crate::statistics::TRACKER_CORE_PERSISTENT_TORRENTS_DOWNLOADS_TOTAL;
10-
use crate::torrent::repository::downloads::DatabaseDownloadsMetricRepository;
1111

1212
pub async fn handle_event(
1313
event: Event,

packages/tracker-core/src/statistics/event/listener.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use torrust_tracker_events::receiver::RecvError;
66
use torrust_tracker_torrent_repository::event::receiver::Receiver;
77

88
use super::handler::handle_event;
9+
use crate::statistics::persisted::downloads::DatabaseDownloadsMetricRepository;
910
use crate::statistics::repository::Repository;
10-
use crate::torrent::repository::downloads::DatabaseDownloadsMetricRepository;
1111
use crate::{CurrentClock, TRACKER_CORE_LOG_TARGET};
1212

1313
#[must_use]

packages/tracker-core/src/torrent/repository/downloads.rs renamed to packages/tracker-core/src/statistics/persisted/downloads.rs

File renamed without changes.

packages/tracker-core/src/statistics/persisted/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
pub mod downloads;
2+
13
use std::sync::Arc;
24

35
use thiserror::Error;
@@ -8,7 +10,7 @@ use torrust_tracker_primitives::DurationSinceUnixEpoch;
810
use super::repository::Repository;
911
use super::TRACKER_CORE_PERSISTENT_TORRENTS_DOWNLOADS_TOTAL;
1012
use crate::databases;
11-
use crate::torrent::repository::downloads::DatabaseDownloadsMetricRepository;
13+
use crate::statistics::persisted::downloads::DatabaseDownloadsMetricRepository;
1214

1315
/// Loads persisted metrics from the database and sets them in the stats repository.
1416
///

0 commit comments

Comments
 (0)