forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.rs
More file actions
25 lines (20 loc) · 634 Bytes
/
Copy pathmod.rs
File metadata and controls
25 lines (20 loc) · 634 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
pub mod statistics;
pub mod torrent;
use std::sync::Arc;
use torrust_tracker_configuration::Configuration;
use crate::tracker::Tracker;
/// # Panics
///
/// Will panic if tracker cannot be instantiated.
#[must_use]
pub fn tracker_factory(config: Arc<Configuration>) -> Tracker {
// Initialize statistics
let (stats_event_sender, stats_repository) = statistics::setup::factory(config.tracker_usage_statistics);
// Initialize Torrust tracker
match Tracker::new(config, stats_event_sender, stats_repository) {
Ok(tracker) => tracker,
Err(error) => {
panic!("{}", error)
}
}
}