forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp_tracker_core.rs
More file actions
26 lines (22 loc) · 811 Bytes
/
http_tracker_core.rs
File metadata and controls
26 lines (22 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use std::sync::Arc;
use tokio::task::JoinHandle;
use tokio_util::sync::CancellationToken;
use torrust_tracker_configuration::Configuration;
use crate::container::AppContainer;
pub fn start_event_listener(
config: &Configuration,
app_container: &Arc<AppContainer>,
cancellation_token: CancellationToken,
) -> Option<JoinHandle<()>> {
if config.core.tracker_usage_statistics {
let job = bittorrent_http_tracker_core::statistics::event::listener::run_event_listener(
app_container.http_tracker_core_services.event_bus.receiver(),
cancellation_token,
&app_container.http_tracker_core_services.stats_repository,
);
Some(job)
} else {
tracing::info!("HTTP tracker core event listener job is disabled.");
None
}
}