We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 837e227 commit e722421Copy full SHA for e722421
src/storage/sqlx/mod.rs
@@ -1,4 +1,4 @@
1
-use std::{any::Any, collections::HashMap};
+use std::{any::Any, collections::HashMap, time::Duration};
2
3
use serde::Deserialize;
4
use serde_json::Value;
@@ -203,7 +203,12 @@ impl SqlxBackend {
203
204
pool.close().await;
205
206
- let pool = sqlx::AnyPool::connect_lazy(database_url)?;
+ let pool = sqlx::any::AnyPoolOptions::new()
207
+ .max_connections(100)
208
+ .idle_timeout(Duration::from_secs(300))
209
+ .max_lifetime(Duration::from_secs(1800))
210
+ .acquire_timeout(Duration::from_secs(5))
211
+ .connect_lazy(database_url)?;
212
213
let lock = SqlxBackendLock::new(&pool, db_scheme.as_str(), 1);
214
Ok(SqlxBackend { pool, table_name: table_name.to_string(), db_scheme, lock })
0 commit comments