Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion srv-lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vial-srv"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
description = """
Framework-agnostic server logic for Vial
Expand Down
6 changes: 3 additions & 3 deletions srv-lib/src/db/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct Handler {

pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("src/migrations");

pub async fn get_connection(url: &str) -> Handler {
pub async fn get_connection(url: &str, max_size: u32, max_idle: Option<u32>) -> Handler {
rustls::crypto::ring::default_provider()
.install_default()
.expect("Failed to install rustls crypto provider");
Expand All @@ -33,8 +33,8 @@ pub async fn get_connection(url: &str) -> Handler {
let mgr = AsyncDieselConnectionManager::<AsyncPgConnection>::new_with_config(url, config);

let conn = Pool::builder()
.max_size(10)
.min_idle(Some(5))
.max_size(max_size)
.min_idle(max_idle)
.max_lifetime(Some(Duration::from_secs(60 * 60 * 24)))
.idle_timeout(Some(Duration::from_secs(60 * 2)))
.build(mgr)
Expand Down
Loading