From df88c2b7bdd46502cc814d278ee808a70a3d60e8 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Mon, 23 Sep 2024 15:14:04 -0400 Subject: [PATCH] fix: busy_timeout to play nice with litestream --- kitchen/src/web/storage/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kitchen/src/web/storage/mod.rs b/kitchen/src/web/storage/mod.rs index 2d04159..6302741 100644 --- a/kitchen/src/web/storage/mod.rs +++ b/kitchen/src/web/storage/mod.rs @@ -14,6 +14,7 @@ use async_std::sync::Arc; use std::collections::BTreeSet; use std::str::FromStr; +use std::time::Duration; use std::{collections::BTreeMap, path::Path}; use argon2::{ @@ -259,6 +260,7 @@ impl SqliteStore { std::fs::create_dir_all(&path)?; let url = format!("sqlite://{}/store.db", path.as_ref().to_string_lossy()); let options = SqliteConnectOptions::from_str(&url)? + .busy_timeout(Duration::from_secs(5)) .journal_mode(SqliteJournalMode::Wal) .create_if_missing(true); info!(?options, "Connecting to sqlite db");