Fix memory db closing

This commit is contained in:
august kline 2024-11-14 11:34:57 -05:00
parent 69e0b87f99
commit 67c0c156cc
1 changed files with 6 additions and 6 deletions

View File

@ -49,13 +49,13 @@ impl BlogDb {
.journal_mode(SqliteJournalMode::Wal),
)
.await?;
#[cfg(debug_assertions)]
{
let db_name = CACHE_URL.strip_prefix("sqlite://").unwrap();
if File::open(db_name).is_err() {
let _ = File::create_new(db_name);
}
// #[cfg(debug_assertions)]
// {
let db_name = CACHE_URL.strip_prefix("sqlite://").unwrap();
if File::open(db_name).is_err() {
let _ = File::create_new(db_name);
}
// }
let memory = SqlitePoolOptions::new()
.min_connections(1)
.connect_with(