Skip to content

Commit 3fa5063

Browse files
committed
refactor: rename DbOrchestartor for DbOrchestrator
1 parent da75e45 commit 3fa5063

4 files changed

Lines changed: 19 additions & 19 deletions

File tree

aggregation_mode/db/src/orchestrator.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct DbNode {
2727

2828
/// Database orchestrator for running reads/writes across multiple PostgreSQL nodes with retry/backoff.
2929
///
30-
/// `DbOrchestartor` holds a list of database nodes (connection pools) and will:
30+
/// `DbOrchestrator` holds a list of database nodes (connection pools) and will:
3131
/// - try nodes in a preferred order (healthy nodes first, then recently-failed nodes),
3232
/// - mark nodes as failed on connection-type errors,
3333
/// - retry transient failures with exponential backoff based on `retry_config`,
@@ -41,18 +41,18 @@ struct DbNode {
4141
/// Clones share health state (the atomics) and the underlying pools, so all clones observe and influence
4242
/// the same “preferred node” ordering decisions.
4343
#[derive(Debug, Clone)]
44-
pub struct DbOrchestartor {
44+
pub struct DbOrchestrator {
4545
nodes: Vec<Arc<DbNode>>,
4646
retry_config: RetryConfig,
4747
}
4848

4949
#[derive(Debug)]
50-
pub enum DbOrchestartorError {
50+
pub enum DbOrchestratorError {
5151
InvalidNumberOfConnectionUrls,
5252
Sqlx(sqlx::Error),
5353
}
5454

55-
impl std::fmt::Display for DbOrchestartorError {
55+
impl std::fmt::Display for DbOrchestratorError {
5656
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5757
match self {
5858
Self::InvalidNumberOfConnectionUrls => {
@@ -63,13 +63,13 @@ impl std::fmt::Display for DbOrchestartorError {
6363
}
6464
}
6565

66-
impl DbOrchestartor {
66+
impl DbOrchestrator {
6767
pub fn try_new(
6868
connection_urls: &[String],
6969
retry_config: RetryConfig,
70-
) -> Result<Self, DbOrchestartorError> {
70+
) -> Result<Self, DbOrchestratorError> {
7171
if connection_urls.is_empty() {
72-
return Err(DbOrchestartorError::InvalidNumberOfConnectionUrls);
72+
return Err(DbOrchestratorError::InvalidNumberOfConnectionUrls);
7373
}
7474

7575
let nodes = connection_urls
@@ -84,7 +84,7 @@ impl DbOrchestartor {
8484
}))
8585
})
8686
.collect::<Result<Vec<_>, sqlx::Error>>()
87-
.map_err(DbOrchestartorError::Sqlx)?;
87+
.map_err(DbOrchestratorError::Sqlx)?;
8888

8989
Ok(Self {
9090
nodes,

aggregation_mode/gateway/src/db.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::types::Receipt;
2-
use db::{orchestrator::DbOrchestartor, retry::RetryConfig};
2+
use db::{orchestrator::DbOrchestrator, retry::RetryConfig};
33
use sqlx::types::{BigDecimal, Uuid};
44

55
// Retry/backoff behavior summary (see
@@ -34,7 +34,7 @@ const RETRY_MAX_DELAY_SECONDS: u64 = 10;
3434

3535
#[derive(Clone, Debug)]
3636
pub struct Db {
37-
orchestrator: DbOrchestartor,
37+
orchestrator: DbOrchestrator,
3838
}
3939

4040
#[derive(Debug, Clone)]
@@ -44,7 +44,7 @@ pub enum DbError {
4444

4545
impl Db {
4646
pub async fn try_new(connection_urls: &[String]) -> Result<Self, DbError> {
47-
let orchestrator = DbOrchestartor::try_new(
47+
let orchestrator = DbOrchestrator::try_new(
4848
connection_urls,
4949
RetryConfig {
5050
min_delay_millis: RETRY_MIN_DELAY_MILLIS,

aggregation_mode/payments_poller/src/db.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use db::{orchestrator::DbOrchestartor, retry::RetryConfig};
1+
use db::{orchestrator::DbOrchestrator, retry::RetryConfig};
22
use sqlx::types::BigDecimal;
33

44
// Retry/backoff behavior summary for DB queries (see
@@ -29,7 +29,7 @@ const RETRY_MAX_DELAY_SECONDS: u64 = 30;
2929

3030
#[derive(Clone, Debug)]
3131
pub struct Db {
32-
orchestartor: DbOrchestartor,
32+
orchestrator: DbOrchestrator,
3333
}
3434

3535
#[derive(Debug, Clone)]
@@ -39,7 +39,7 @@ pub enum DbError {
3939

4040
impl Db {
4141
pub async fn try_new(connection_urls: &[String]) -> Result<Self, DbError> {
42-
let orchestartor = DbOrchestartor::try_new(
42+
let orchestrator = DbOrchestrator::try_new(
4343
connection_urls,
4444
RetryConfig {
4545
min_delay_millis: RETRY_MIN_DELAY_MILLIS,
@@ -50,7 +50,7 @@ impl Db {
5050
)
5151
.map_err(|e| DbError::ConnectError(e.to_string()))?;
5252

53-
Ok(Self { orchestartor })
53+
Ok(Self { orchestrator })
5454
}
5555

5656
pub async fn insert_payment_event(
@@ -61,7 +61,7 @@ impl Db {
6161
valid_until: &BigDecimal,
6262
tx_hash: &str,
6363
) -> Result<(), sqlx::Error> {
64-
self.orchestartor
64+
self.orchestrator
6565
.write(async |pool| {
6666
sqlx::query(
6767
"INSERT INTO payment_events (address, started_at, amount, valid_until, tx_hash)

aggregation_mode/proof_aggregator/src/backend/db.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use db::{orchestrator::DbOrchestartor, retry::RetryConfig, types::Task};
1+
use db::{orchestrator::DbOrchestrator, retry::RetryConfig, types::Task};
22
use sqlx::types::Uuid;
33

44
// Retry/backoff behavior summary (see
@@ -29,7 +29,7 @@ const RETRY_MAX_DELAY_SECONDS: u64 = 30;
2929

3030
#[derive(Debug, Clone)]
3131
pub struct Db {
32-
orchestrator: DbOrchestartor,
32+
orchestrator: DbOrchestrator,
3333
}
3434

3535
#[derive(Debug, Clone)]
@@ -40,7 +40,7 @@ pub enum DbError {
4040

4141
impl Db {
4242
pub async fn try_new(connection_urls: &[String]) -> Result<Self, DbError> {
43-
let orchestrator = DbOrchestartor::try_new(
43+
let orchestrator = DbOrchestrator::try_new(
4444
connection_urls,
4545
RetryConfig {
4646
min_delay_millis: RETRY_MIN_DELAY_MILLIS,

0 commit comments

Comments
 (0)