Skip to content

Commit 51085bd

Browse files
committed
chore: read connection urls vector from config
1 parent d472330 commit 51085bd

File tree

15 files changed

+19
-14
lines changed

15 files changed

+19
-14
lines changed

aggregation_mode/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aggregation_mode/db/src/orchestrator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl std::fmt::Display for DbOrchestartorError {
6666

6767
impl DbOrchestartor {
6868
pub fn try_new(
69-
connection_urls: &[&str],
69+
connection_urls: &[String],
7070
retry_config: RetryConfig,
7171
) -> Result<Self, DbOrchestartorError> {
7272
if connection_urls.is_empty() {

aggregation_mode/gateway/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
55
#[derive(Clone, Debug, Deserialize, Serialize)]
66
pub struct Config {
77
pub port: u16,
8-
pub db_connection_url: String,
8+
pub db_connection_urls: Vec<String>,
99
pub network: String,
1010
pub max_daily_proofs_per_user: i64,
1111
}

aggregation_mode/gateway/src/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub enum DbError {
1414
}
1515

1616
impl Db {
17-
pub async fn try_new(connection_urls: &[&str]) -> Result<Self, DbError> {
17+
pub async fn try_new(connection_urls: &[String]) -> Result<Self, DbError> {
1818
let orchestrator = DbOrchestartor::try_new(
1919
connection_urls,
2020
RetryConfig {

aggregation_mode/gateway/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async fn main() {
2626
let config = Config::from_file(&config_file_path).expect("Config is valid");
2727
tracing::info!("Config loaded");
2828

29-
let db = Db::try_new(&[config.db_connection_url.as_str()])
29+
let db = Db::try_new(config.db_connection_urls.as_slice())
3030
.await
3131
.expect("db to start");
3232

aggregation_mode/payments_poller/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
44

55
#[derive(Clone, Debug, Deserialize, Serialize)]
66
pub struct Config {
7-
pub db_connection_url: String,
7+
pub db_connection_urls: Vec<String>,
88
pub eth_rpc_url: String,
99
pub payment_service_address: String,
1010
}

aggregation_mode/payments_poller/src/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub enum DbError {
1212
}
1313

1414
impl Db {
15-
pub async fn try_new(connection_urls: &[&str]) -> Result<Self, DbError> {
15+
pub async fn try_new(connection_urls: &[String]) -> Result<Self, DbError> {
1616
let orchestartor = DbOrchestartor::try_new(
1717
connection_urls,
1818
RetryConfig {

aggregation_mode/payments_poller/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async fn main() {
2626
let config = Config::from_file(&config_file_path).expect("Config is valid");
2727
tracing::info!("Config loaded");
2828

29-
let db = Db::try_new(&[config.db_connection_url.as_str()])
29+
let db = Db::try_new(&config.db_connection_urls.as_slice())
3030
.await
3131
.expect("db to start");
3232

aggregation_mode/proof_aggregator/src/backend/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct Config {
2020
pub risc0_chunk_aggregator_image_id: String,
2121
pub sp1_chunk_aggregator_vk_hash: String,
2222
pub monthly_budget_eth: f64,
23-
pub db_connection_url: String,
23+
pub db_connection_urls: Vec<String>,
2424
}
2525

2626
impl Config {

aggregation_mode/proof_aggregator/src/backend/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub enum DbError {
2323
}
2424

2525
impl Db {
26-
pub async fn try_new(connection_urls: &[&str]) -> Result<Self, DbError> {
26+
pub async fn try_new(connection_urls: &[String]) -> Result<Self, DbError> {
2727
let orchestrator = DbOrchestartor::try_new(
2828
connection_urls,
2929
RetryConfig {

0 commit comments

Comments
 (0)