diff --git a/config.toml b/config.toml index a3edb91..3dea8ee 100644 --- a/config.toml +++ b/config.toml @@ -42,7 +42,7 @@ description = "A newly created nostr-rs-relay.\n\nCustomize this with your own i # Database connection pool settings for subscribers: # Minimum number of SQLite reader connections -#min_conn = 4 +#min_conn = 0 # Maximum number of SQLite reader connections. Recommend setting this # to approx the number of cores. diff --git a/src/repo/sqlite.rs b/src/repo/sqlite.rs index 91b48e6..b156f0c 100644 --- a/src/repo/sqlite.rs +++ b/src/repo/sqlite.rs @@ -62,7 +62,7 @@ impl SqliteRepo { "writer", settings, OpenFlags::SQLITE_OPEN_READ_WRITE | OpenFlags::SQLITE_OPEN_CREATE, - 1, + 0, 2, false, ); @@ -70,7 +70,7 @@ impl SqliteRepo { "maintenance", settings, OpenFlags::SQLITE_OPEN_READ_WRITE | OpenFlags::SQLITE_OPEN_CREATE, - 1, + 0, 2, true, ); @@ -1199,6 +1199,7 @@ pub fn build_pool( .test_on_check_out(true) // no noticeable performance hit .min_idle(Some(min_size)) .max_size(max_size) + .idle_timeout(Some(Duration::from_secs(10))) .max_lifetime(Some(Duration::from_secs(30))) .build(manager) .unwrap();