Skip to content

Commit 81fd9ed

Browse files
authored
[BUG]: Setting max_lifetime and max_timeout to None for in-memory DB (#4347)
#4332 ## Description of changes *Summarize the changes made by this PR.* - Improvements & Bug fixes - Default sqlx pool options close idle connections for in-memory DB after 10mins which clears the data in the DB causing subsequent client calls to fail with sqlite errors. This PR sets max_lifetime and idle_timeout for in-memmory DB to None which prevents connection from being reaped ## Test plan *How are these changes tested?* - [ ] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes
1 parent 197c999 commit 81fd9ed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rust/sqlite/src/config.rs

+2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ impl Configurable<SqliteDBConfig, SqliteCreationError> for SqliteDb {
115115
.await?
116116
} else {
117117
SqlitePoolOptions::new()
118+
.max_lifetime(None)
119+
.idle_timeout(None)
118120
.max_connections(1)
119121
.connect_with(conn_options.in_memory(true).shared_cache(true))
120122
.await?

0 commit comments

Comments
 (0)