Increase the number of database concurrent connection

This commit is contained in:
Greg Burri 2024-12-05 01:11:14 +01:00
parent 45ac5276d4
commit de19c3fa5d
2 changed files with 9 additions and 1 deletions

View file

@ -119,7 +119,13 @@ impl Connection {
.pragma("foreign_keys", "ON")
.pragma("synchronous", "NORMAL");
Self::create_connection(SqlitePoolOptions::new().connect_with(options).await?).await
Self::create_connection(
SqlitePoolOptions::new()
.max_connections(consts::MAX_DB_CONNECTION)
.connect_with(options)
.await?,
)
.await
}
async fn create_connection(pool: Pool<Sqlite>) -> Result<Connection> {