Skip to content

Commit 45bc807

Browse files
committed
refactor: [#1534] rename TORRENT_REPOSITORY_LOG_TARGET to SWARM_COORDINATION_REGISTRY_LOG_TARGET
1 parent 0e3a305 commit 45bc807

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/swarm-coordination-registry/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub(crate) type CurrentClock = clock::Working;
2222
#[allow(dead_code)]
2323
pub(crate) type CurrentClock = clock::Stopped;
2424

25-
pub const TORRENT_REPOSITORY_LOG_TARGET: &str = "TORRENT_REPOSITORY";
25+
pub const SWARM_COORDINATION_REGISTRY_LOG_TARGET: &str = "SWARM_COORDINATION_REGISTRY";
2626

2727
#[cfg(test)]
2828
pub(crate) mod tests {

packages/swarm-coordination-registry/src/statistics/event/listener.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ use torrust_tracker_events::receiver::RecvError;
77
use super::handler::handle_event;
88
use crate::event::receiver::Receiver;
99
use crate::statistics::repository::Repository;
10-
use crate::{CurrentClock, TORRENT_REPOSITORY_LOG_TARGET};
10+
use crate::{CurrentClock, SWARM_COORDINATION_REGISTRY_LOG_TARGET};
1111

1212
#[must_use]
1313
pub fn run_event_listener(receiver: Receiver, repository: &Arc<Repository>) -> JoinHandle<()> {
1414
let stats_repository = repository.clone();
1515

16-
tracing::info!(target: TORRENT_REPOSITORY_LOG_TARGET, "Starting torrent repository event listener");
16+
tracing::info!(target: SWARM_COORDINATION_REGISTRY_LOG_TARGET, "Starting torrent repository event listener");
1717

1818
tokio::spawn(async move {
1919
dispatch_events(receiver, stats_repository).await;
2020

21-
tracing::info!(target: TORRENT_REPOSITORY_LOG_TARGET, "Torrent repository listener finished");
21+
tracing::info!(target: SWARM_COORDINATION_REGISTRY_LOG_TARGET, "Torrent repository listener finished");
2222
})
2323
}
2424

@@ -32,7 +32,7 @@ async fn dispatch_events(mut receiver: Receiver, stats_repository: Arc<Repositor
3232
biased;
3333

3434
_ = &mut shutdown_signal => {
35-
tracing::info!(target: TORRENT_REPOSITORY_LOG_TARGET, "Received Ctrl+C, shutting down torrent repository event listener.");
35+
tracing::info!(target: SWARM_COORDINATION_REGISTRY_LOG_TARGET, "Received Ctrl+C, shutting down torrent repository event listener.");
3636
break;
3737
}
3838

@@ -42,11 +42,11 @@ async fn dispatch_events(mut receiver: Receiver, stats_repository: Arc<Repositor
4242
Err(e) => {
4343
match e {
4444
RecvError::Closed => {
45-
tracing::info!(target: TORRENT_REPOSITORY_LOG_TARGET, "Torrent repository event receiver closed.");
45+
tracing::info!(target: SWARM_COORDINATION_REGISTRY_LOG_TARGET, "Torrent repository event receiver closed.");
4646
break;
4747
}
4848
RecvError::Lagged(n) => {
49-
tracing::warn!(target: TORRENT_REPOSITORY_LOG_TARGET, "Torrent repository event receiver lagged by {} events.", n);
49+
tracing::warn!(target: SWARM_COORDINATION_REGISTRY_LOG_TARGET, "Torrent repository event receiver lagged by {} events.", n);
5050
}
5151
}
5252
}

0 commit comments

Comments
 (0)