fix(gpodder_sqlite): force in-memory database to consist of only one connection
parent
fe8939c07e
commit
22016fe0e9
|
@ -98,6 +98,10 @@ pub fn initialize_db(path: impl AsRef<Path>, run_migrations: bool) -> Result<DbP
|
|||
pub fn initialize_db_in_memory(run_migrations: bool) -> Result<DbPool, DbError> {
|
||||
let manager = ConnectionManager::<SqliteConnection>::new(":memory:");
|
||||
let pool = Pool::builder()
|
||||
// An in-memory database is recreated for each opened connection, so we try to force only a
|
||||
// single connection to stay alive
|
||||
.min_idle(Some(1))
|
||||
.max_size(1)
|
||||
.connection_customizer(Box::new(AddQueryDebugLogs))
|
||||
.build(manager)?;
|
||||
|
||||
|
|
Loading…
Reference in New Issue