Skip to content

Commit

Permalink
Use factored out Postgres config args
Browse files Browse the repository at this point in the history
  • Loading branch information
alfiedotwtf committed Sep 27, 2023
1 parent 4d50127 commit 4b49754
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
19 changes: 7 additions & 12 deletions api-server/scanner-daemon/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,7 @@ async fn main() -> Result<(), ApiServerScannerError> {
rpc_cookie_file,
rpc_username,
rpc_password,
postgres_host,
postgres_port,
postgres_user,
postgres_password,
postgres_database,
postgres_max_connections,
postgres_config,
} = args;

let chain_type: ChainType = network.into();
Expand Down Expand Up @@ -161,12 +156,12 @@ async fn main() -> Result<(), ApiServerScannerError> {
.map_err(ApiServerScannerError::RpcError)?;

let storage = make_postgres_storage(
postgres_host,
postgres_port,
postgres_user,
postgres_password,
postgres_database,
postgres_max_connections,
postgres_config.postgres_host,
postgres_config.postgres_port,
postgres_config.postgres_user,
postgres_config.postgres_password,
postgres_config.postgres_database,
postgres_config.postgres_max_connections,
&chain_config,
)
.await?;
Expand Down
12 changes: 6 additions & 6 deletions api-server/web-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ async fn main() {
let chain_config = Arc::new(create_unit_test_config());

let storage = TransactionalApiServerPostgresStorage::new(
&args.postgres_host,
args.postgres_port,
&args.postgres_user,
args.postgres_password.as_deref(),
args.postgres_database.as_deref(),
args.postgres_max_connections,
&args.postgres_config.postgres_host,
args.postgres_config.postgres_port,
&args.postgres_config.postgres_user,
args.postgres_config.postgres_password.as_deref(),
args.postgres_config.postgres_database.as_deref(),
args.postgres_config.postgres_max_connections,
&chain_config,
)
.await
Expand Down

0 comments on commit 4b49754

Please sign in to comment.