Fix memory db closing
This commit is contained in:
parent
69e0b87f99
commit
67c0c156cc
12
src/lib.rs
12
src/lib.rs
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue