@@ -117,32 +117,35 @@ pub fn start(
117117 error ! ( "Failed to send heartbeat from importer cronjob: {}" , e) ;
118118 }
119119
120- match weak_tracker_statistics_importer. upgrade ( ) { Some ( statistics_importer) => {
121- let one_interval_ago = seconds_ago_utc (
122- torrent_stats_update_interval
123- . try_into ( )
124- . expect ( "update interval should be a positive integer" ) ,
125- ) ;
126- let limit = 50 ;
127-
128- debug ! (
129- "Importing torrents statistics not updated since {} limited to a maximum of {} torrents ..." ,
130- one_interval_ago. to_string( ) . yellow( ) ,
131- limit. to_string( ) . yellow( )
132- ) ;
133-
134- match statistics_importer
135- . import_torrents_statistics_not_updated_since ( one_interval_ago, limit)
136- . await
137- {
138- Ok ( ( ) ) => { }
139- Err ( e) => error ! ( "Failed to import statistics: {:?}" , e) ,
120+ match weak_tracker_statistics_importer. upgrade ( ) {
121+ Some ( statistics_importer) => {
122+ let one_interval_ago = seconds_ago_utc (
123+ torrent_stats_update_interval
124+ . try_into ( )
125+ . expect ( "update interval should be a positive integer" ) ,
126+ ) ;
127+ let limit = 50 ;
128+
129+ debug ! (
130+ "Importing torrents statistics not updated since {} limited to a maximum of {} torrents ..." ,
131+ one_interval_ago. to_string( ) . yellow( ) ,
132+ limit. to_string( ) . yellow( )
133+ ) ;
134+
135+ match statistics_importer
136+ . import_torrents_statistics_not_updated_since ( one_interval_ago, limit)
137+ . await
138+ {
139+ Ok ( ( ) ) => { }
140+ Err ( e) => error ! ( "Failed to import statistics: {:?}" , e) ,
141+ }
142+
143+ drop ( statistics_importer) ;
140144 }
141-
142- drop ( statistics_importer) ;
143- } _ => {
144- break ;
145- } }
145+ _ => {
146+ break ;
147+ }
148+ }
146149
147150 execution_interval. tick ( ) . await ;
148151 }
0 commit comments