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