Skip to content

Commit 4b49754

Browse files
committed
Use factored out Postgres config args
1 parent 4d50127 commit 4b49754

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

api-server/scanner-daemon/src/main.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,7 @@ async fn main() -> Result<(), ApiServerScannerError> {
124124
rpc_cookie_file,
125125
rpc_username,
126126
rpc_password,
127-
postgres_host,
128-
postgres_port,
129-
postgres_user,
130-
postgres_password,
131-
postgres_database,
132-
postgres_max_connections,
127+
postgres_config,
133128
} = args;
134129

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

163158
let storage = make_postgres_storage(
164-
postgres_host,
165-
postgres_port,
166-
postgres_user,
167-
postgres_password,
168-
postgres_database,
169-
postgres_max_connections,
159+
postgres_config.postgres_host,
160+
postgres_config.postgres_port,
161+
postgres_config.postgres_user,
162+
postgres_config.postgres_password,
163+
postgres_config.postgres_database,
164+
postgres_config.postgres_max_connections,
170165
&chain_config,
171166
)
172167
.await?;

api-server/web-server/src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ async fn main() {
4444
let chain_config = Arc::new(create_unit_test_config());
4545

4646
let storage = TransactionalApiServerPostgresStorage::new(
47-
&args.postgres_host,
48-
args.postgres_port,
49-
&args.postgres_user,
50-
args.postgres_password.as_deref(),
51-
args.postgres_database.as_deref(),
52-
args.postgres_max_connections,
47+
&args.postgres_config.postgres_host,
48+
args.postgres_config.postgres_port,
49+
&args.postgres_config.postgres_user,
50+
args.postgres_config.postgres_password.as_deref(),
51+
args.postgres_config.postgres_database.as_deref(),
52+
args.postgres_config.postgres_max_connections,
5353
&chain_config,
5454
)
5555
.await

0 commit comments

Comments
 (0)