Skip to content

Commit

Permalink
Update in-memory database initialization string and add idle_timeout …
Browse files Browse the repository at this point in the history
…to pool options in database.rs
  • Loading branch information
nullchinchilla committed Mar 27, 2024
1 parent 8c11682 commit 81afc79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion binaries/geph5-client/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static DATABASE: CtxField<SqlitePool> = |ctx| {
.cache
.as_ref()
.map(|s| s.to_string_lossy().to_string())
.unwrap_or_else(|| ":memory:?cache=shared".into());
.unwrap_or_else(|| "file:memdb1?mode=memory&cache=shared".into());
tracing::debug!("INITIALIZING DATABASE");
let options = dbg!(SqliteConnectOptions::from_str(&db_path))
.unwrap()
Expand All @@ -22,6 +22,7 @@ static DATABASE: CtxField<SqlitePool> = |ctx| {
let pool = PoolOptions::new()
.min_connections(1)
.max_connections(100)
.idle_timeout(None)
.connect_lazy_with(options);

sqlx::query(
Expand Down

0 comments on commit 81afc79

Please sign in to comment.