From 2e223346312e318c9524674b5116f40df7765f30 Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Sun, 25 Dec 2022 11:06:30 -0600 Subject: [PATCH] refactor: formatting --- src/db.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/db.rs b/src/db.rs index 7ee1720..16eff92 100644 --- a/src/db.rs +++ b/src/db.rs @@ -695,19 +695,19 @@ pub async fn db_maintenance(pool: SqlitePool) { tokio::task::spawn(async move { loop { tokio::select! { - _ = tokio::time::sleep(Duration::from_secs(EVENT_MAINTENANCE_FREQ_SEC)) => { - if let Ok(mut conn) = pool.get() { - // the busy timer will block writers, so don't set - // this any higher than you want max latency for event - // writes. - conn.busy_timeout(Duration::from_secs(1)).ok(); - debug!("running database optimizer"); - optimize_db(&mut conn).ok(); - debug!("running wal_checkpoint(TRUNCATE)"); - checkpoint_db(&mut conn).ok(); - } - } - }; + _ = tokio::time::sleep(Duration::from_secs(EVENT_MAINTENANCE_FREQ_SEC)) => { + if let Ok(mut conn) = pool.get() { + // the busy timer will block writers, so don't set + // this any higher than you want max latency for event + // writes. + conn.busy_timeout(Duration::from_secs(1)).ok(); + debug!("running database optimizer"); + optimize_db(&mut conn).ok(); + debug!("running wal_checkpoint(TRUNCATE)"); + checkpoint_db(&mut conn).ok(); + } + } + }; } }); }