@@ -27,7 +27,7 @@ use tokio::task::JoinHandle;
2727use torrust_tracker_configuration:: { Configuration , HttpTracker , UdpTracker } ;
2828use tracing:: instrument;
2929
30- use crate :: bootstrap:: jobs:: { health_check_api, http_tracker, torrent_cleanup, tracker_apis, udp_tracker} ;
30+ use crate :: bootstrap:: jobs:: { self , health_check_api, http_tracker, torrent_cleanup, tracker_apis, udp_tracker} ;
3131use crate :: bootstrap:: { self } ;
3232use crate :: container:: AppContainer ;
3333
@@ -110,63 +110,42 @@ async fn load_whitelisted_torrents(config: &Configuration, app_container: &Arc<A
110110}
111111
112112fn start_http_core_event_listener ( config : & Configuration , app_container : & Arc < AppContainer > ) {
113- if config. core . tracker_usage_statistics {
114- let _job = bittorrent_http_tracker_core:: statistics:: event:: listener:: run_event_listener (
115- app_container. http_tracker_core_services . event_bus . receiver ( ) ,
116- & app_container. http_tracker_core_services . stats_repository ,
117- ) ;
118-
119- // todo: this cannot be enabled otherwise the application never ends
120- // because the event listener never stops. You see this console message
121- // forever:
122- //
123- // !! shuting down in 90 seconds !!
124- // 2025-04-24T15:27:45.454101Z INFO graceful_shutdown: torrust_axum_server::signals: remaining alive connections: 0
125- //
126- // Depends on: https://github.com/torrust/torrust-tracker/issues/1405
127-
128- //jobs.push(job);
129- }
113+ let _job = jobs:: http_tracker_core:: start_event_listener ( config, app_container) ;
114+
115+ // todo: this cannot be enabled otherwise the application never ends
116+ // because the event listener never stops. You see this console message
117+ // forever:
118+ //
119+ // !! shuting down in 90 seconds !!
120+ // 2025-04-24T15:27:45.454101Z INFO graceful_shutdown: torrust_axum_server::signals: remaining alive connections: 0
121+ //
122+ // Depends on: https://github.com/torrust/torrust-tracker/issues/1405
130123}
131124
132125fn start_udp_core_event_listener ( config : & Configuration , app_container : & Arc < AppContainer > ) {
133- if config. core . tracker_usage_statistics {
134- let _job = bittorrent_udp_tracker_core:: statistics:: event:: listener:: run_event_listener (
135- app_container. udp_tracker_core_services . event_bus . receiver ( ) ,
136- & app_container. udp_tracker_core_services . stats_repository ,
137- ) ;
138-
139- // todo: this cannot be enabled otherwise the application never ends
140- // because the event listener never stops. You see this console message
141- // forever:
142- //
143- // !! shuting down in 90 seconds !!
144- // 2025-04-24T15:27:45.454101Z INFO graceful_shutdown: torrust_axum_server::signals: remaining alive connections: 0
145- //
146- // Depends on: https://github.com/torrust/torrust-tracker/issues/1405
147-
148- //jobs.push(job);
149- }
126+ let _job = jobs:: udp_tracker_core:: start_event_listener ( config, app_container) ;
127+
128+ // todo: the job cannot be added in the jobs vector otherwise the application never ends
129+ // because the event listener never stops. You see this console message
130+ // forever:
131+ //
132+ // !! shuting down in 90 seconds !!
133+ // 2025-04-24T15:27:45.454101Z INFO graceful_shutdown: torrust_axum_server::signals: remaining alive connections: 0
134+ //
135+ // Depends on: https://github.com/torrust/torrust-tracker/issues/1405
150136}
151137
152138fn start_udp_server_event_listener ( config : & Configuration , app_container : & Arc < AppContainer > ) {
153- if config. core . tracker_usage_statistics {
154- let _job = torrust_udp_tracker_server:: statistics:: event:: listener:: run_event_listener (
155- app_container. udp_tracker_server_container . event_bus . receiver ( ) ,
156- & app_container. udp_tracker_server_container . stats_repository ,
157- ) ;
158-
159- // todo: this cannot be enabled otherwise the application never ends
160- // because the event listener never stops. You see this console message
161- // forever:
162- //
163- // !! shuting down in 90 seconds !!
164- // 2025-04-24T15:27:45.454101Z INFO graceful_shutdown: torrust_axum_server::signals: remaining alive connections: 0
165- //
166- // Depends on: https://github.com/torrust/torrust-tracker/issues/1405
167-
168- //jobs.push(job);
169- }
139+ let _job = jobs:: udp_tracker_server:: start_event_listener ( config, app_container) ;
140+
141+ // todo: the job cannot be added in the jobs vector otherwise the application never ends
142+ // because the event listener never stops. You see this console message
143+ // forever:
144+ //
145+ // !! shuting down in 90 seconds !!
146+ // 2025-04-24T15:27:45.454101Z INFO graceful_shutdown: torrust_axum_server::signals: remaining alive connections: 0
147+ //
148+ // Depends on: https://github.com/torrust/torrust-tracker/issues/1405
170149}
171150
172151async fn start_the_udp_instances ( config : & Configuration , app_container : & Arc < AppContainer > , jobs : & mut Vec < JoinHandle < ( ) > > ) {
0 commit comments