Skip to content

Commit

Permalink
set max_connections for tmp db options
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Nov 20, 2024
1 parent 12c8e6b commit 403826c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions sequencer/src/api/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ mod impl_testable_data_source {

Options {
postgres_options: opt,
max_connections: 10,
..Default::default()
}
}
Expand All @@ -480,6 +481,7 @@ mod impl_testable_data_source {

Options {
sqlite_options: opt,
max_connections: 3,
..Default::default()
}
}
Expand Down
5 changes: 2 additions & 3 deletions sequencer/src/persistence/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub struct Options {
#[clap(
long,
env = "ESPRESSO_SEQUENCER_DATABASE_MAX_CONNECTIONS",
default_value = "25"
default_value = "25"
)]
pub(crate) max_connections: u32,

Expand Down Expand Up @@ -273,8 +273,7 @@ impl TryFrom<Options> for Config {
cfg = cfg.pool(pool);
}

// This results in a weird panic so it has been commented out for now.
// cfg = cfg.max_connections(opt.max_connections);
cfg = cfg.max_connections(opt.max_connections);
cfg = cfg.idle_connection_timeout(opt.idle_connection_timeout);
cfg = cfg.min_connections(opt.min_connections);
cfg = cfg.connection_timeout(opt.connection_timeout);
Expand Down

0 comments on commit 403826c

Please sign in to comment.