Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config Max DB Connections #133

Merged
merged 1 commit into from
Mar 11, 2024
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 das_api/src/api/api_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct DasApi {
impl DasApi {
pub async fn from_config(config: Config) -> Result<Self, DasApiError> {
let pool = PgPoolOptions::new()
.max_connections(250)
.max_connections(config.max_database_connections.unwrap_or(250))
.connect(&config.database_url)
.await?;

Expand Down
1 change: 1 addition & 0 deletions das_api/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use {
#[derive(Deserialize, Default)]
pub struct Config {
pub database_url: String,
pub max_database_connections: Option<u32>,
pub metrics_port: Option<u16>,
pub metrics_host: Option<String>,
pub server_port: u16,
Expand Down
Loading