@@ -15,14 +15,21 @@ pub fn run_event_listener(
1515 receiver : Receiver ,
1616 repository : & Arc < Repository > ,
1717 db_torrent_repository : & Arc < DatabasePersistentTorrentRepository > ,
18+ persistent_torrent_completed_stat : bool ,
1819) -> JoinHandle < ( ) > {
1920 let stats_repository = repository. clone ( ) ;
2021 let db_torrent_repository: Arc < DatabasePersistentTorrentRepository > = db_torrent_repository. clone ( ) ;
2122
2223 tracing:: info!( target: TRACKER_CORE_LOG_TARGET , "Starting torrent repository event listener" ) ;
2324
2425 tokio:: spawn ( async move {
25- dispatch_events ( receiver, stats_repository, db_torrent_repository) . await ;
26+ dispatch_events (
27+ receiver,
28+ stats_repository,
29+ db_torrent_repository,
30+ persistent_torrent_completed_stat,
31+ )
32+ . await ;
2633
2734 tracing:: info!( target: TRACKER_CORE_LOG_TARGET , "Torrent repository listener finished" ) ;
2835 } )
@@ -32,6 +39,7 @@ async fn dispatch_events(
3239 mut receiver : Receiver ,
3340 stats_repository : Arc < Repository > ,
3441 db_torrent_repository : Arc < DatabasePersistentTorrentRepository > ,
42+ persistent_torrent_completed_stat : bool ,
3543) {
3644 let shutdown_signal = tokio:: signal:: ctrl_c ( ) ;
3745
@@ -48,7 +56,12 @@ async fn dispatch_events(
4856
4957 result = receiver. recv( ) => {
5058 match result {
51- Ok ( event) => handle_event( event, & stats_repository, & db_torrent_repository, CurrentClock :: now( ) ) . await ,
59+ Ok ( event) => handle_event(
60+ event,
61+ & stats_repository,
62+ & db_torrent_repository,
63+ persistent_torrent_completed_stat,
64+ CurrentClock :: now( ) ) . await ,
5265 Err ( e) => {
5366 match e {
5467 RecvError :: Closed => {
0 commit comments