File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -345,15 +345,15 @@ cfg_if! {
345345 if global. retention. is_none( ) {
346346 continue ;
347347 }
348- let Ok ( mut db) = global. db_manager. get( ) else {
349- tracing:: warn!( "Failed to get DB handle for cleanup" ) ;
350- continue ;
351- } ;
352348 let Some ( since) = std:: time:: SystemTime :: now( ) . checked_sub( interval) else {
353349 tracing:: warn!( "Overflow when clean up time" ) ;
354350 continue ;
355351 } ;
356- tracing:: info!( "Cleanup result: {:#?}" , db. delete_invocations_since( & since) ) ;
352+ db:: run( global. db_manager. clone( ) , move |db_mgr| db_mgr. delete_invocations_since( & since) ) . await . inspect_err( |e| {
353+ tracing:: warn!( "Failed to mark old invocations for deletion: {e:#?}" ) ;
354+ } ) . ok( ) . inspect( |count| {
355+ tracing:: info!( "Marked {} invocations for deletion" , count) ;
356+ } ) ;
357357 }
358358 }
359359
You can’t perform that action at this time.
0 commit comments