From b334b3cf145d0dfa12fd07085cc0fbe7c9f48cf1 Mon Sep 17 00:00:00 2001 From: Reinier Maas Date: Tue, 20 Jan 2026 13:26:48 +0100 Subject: [PATCH] Timeout initiating sqlite --- opsqueue/app/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/opsqueue/app/main.rs b/opsqueue/app/main.rs index 010ffa0..deeeb21 100644 --- a/opsqueue/app/main.rs +++ b/opsqueue/app/main.rs @@ -34,8 +34,12 @@ pub async fn async_main() { // will not be seen otherwise let prometheus_config = opsqueue::prometheus::setup_prometheus(); - let db_pool = - opsqueue::db::open_and_setup(&config.database_filename, config.max_read_pool_size).await; + let db_pool = tokio::time::timeout( + Duration::from_secs(10), + opsqueue::db::open_and_setup(&config.database_filename, config.max_read_pool_size), + ) + .await + .expect("Timed out while initiating the database"); moro_local::async_scope!(|scope| { scope.spawn(opsqueue::server::serve_producer_and_consumer(