File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed
Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change @@ -22,35 +22,13 @@ impl DatabaseMaintenance {
2222
2323 /// Runs the maintenance tasks in a loop.
2424 pub async fn run ( self ) {
25- self . startup_maintenance ( ) . await ;
26-
2725 loop {
2826 tokio:: time:: sleep ( std:: time:: Duration :: from_secs ( PERIODIC_MAINTENANCE_INTERVAL_SECS ) )
2927 . await ;
3028 self . periodic_maintenance ( ) . await ;
3129 }
3230 }
3331
34- /// Runs maintenance tasks at startup.
35- ///
36- /// This includes running `ANALYZE` and `PRAGMA optimize`.
37- async fn startup_maintenance ( & self ) {
38- let db = self . db . inner ( ) ;
39- let conn = db. get_connection ( ) ;
40-
41- tracing:: info!( target: "scroll::db::maintenance" , "running startup ANALYZE..." ) ;
42- if let Err ( err) = conn. execute_unprepared ( "ANALYZE;" ) . await {
43- tracing:: warn!( target: "scroll::db::maintenance" , "ANALYZE failed: {:?}" , err) ;
44- }
45-
46- tracing:: info!( target: "scroll::db::maintenance" , "running PRAGMA optimize at startup..." ) ;
47- if let Err ( err) = conn. execute_unprepared ( "PRAGMA optimize;" ) . await {
48- tracing:: warn!( target: "scroll::db::maintenance" , "PRAGMA optimize failed: {:?}" , err) ;
49- }
50-
51- tracing:: info!( target: "scroll::db::maintenance" , "startup maintenance complete." ) ;
52- }
53-
5432 /// Runs periodic maintenance tasks.
5533 ///
5634 /// This includes running `PRAGMA optimize`.
You can’t perform that action at this time.
0 commit comments