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),
|
.journal_mode(SqliteJournalMode::Wal),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
#[cfg(debug_assertions)]
|
// #[cfg(debug_assertions)]
|
||||||
{
|
// {
|
||||||
let db_name = CACHE_URL.strip_prefix("sqlite://").unwrap();
|
let db_name = CACHE_URL.strip_prefix("sqlite://").unwrap();
|
||||||
if File::open(db_name).is_err() {
|
if File::open(db_name).is_err() {
|
||||||
let _ = File::create_new(db_name);
|
let _ = File::create_new(db_name);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
let memory = SqlitePoolOptions::new()
|
let memory = SqlitePoolOptions::new()
|
||||||
.min_connections(1)
|
.min_connections(1)
|
||||||
.connect_with(
|
.connect_with(
|
||||||
|
|
Loading…
Reference in New Issue