From 7dc8ede8eba0558126a3552ecf9cf96facf36854 Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 22 Jul 2023 20:26:28 -0500 Subject: [PATCH] Gate cleanup behind read-only config --- src/lib.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c326561..8b9cb26 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1344,10 +1344,14 @@ fn configure_endpoints< ); } -fn spawn_cleanup(repo: R) +fn spawn_cleanup(repo: R, config: &Configuration) where R: FullRepo + 'static, { + if config.server.read_only { + return; + } + tracing::trace_span!(parent: None, "Spawn task").in_scope(|| { actix_rt::spawn(async move { let mut interval = actix_rt::time::interval(Duration::from_secs(30)); @@ -1404,7 +1408,7 @@ async fn launch_file_store