Skip to content

Commit

Permalink
Rename 'interval' to 'rate' for brevity
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurshsmith committed Nov 11, 2023
1 parent 618174c commit 2c65f9f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions chaindexing/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ pub struct Config {
pub contracts: Vec<Contract>,
pub min_confirmation_count: MinConfirmationCount,
pub blocks_per_batch: u64,
pub handler_interval_ms: u64,
pub ingestion_interval_ms: u64,
pub handler_rate_ms: u64,
pub ingestion_rate_ms: u64,
pub reset_count: u8,
}

Expand All @@ -37,8 +37,8 @@ impl Config {
contracts: vec![],
min_confirmation_count: MinConfirmationCount::new(40),
blocks_per_batch: 10000,
handler_interval_ms: 4000,
ingestion_interval_ms: 4000,
handler_rate_ms: 4000,
ingestion_rate_ms: 4000,
reset_count: 0,
}
}
Expand Down Expand Up @@ -67,14 +67,14 @@ impl Config {
self
}

pub fn with_handler_interval_ms(mut self, handler_interval_ms: u64) -> Self {
self.handler_interval_ms = handler_interval_ms;
pub fn with_handler_rate_ms(mut self, handler_rate_ms: u64) -> Self {
self.handler_rate_ms = handler_rate_ms;

self
}

pub fn with_ingestion_interval_ms(mut self, ingestion_interval_ms: u64) -> Self {
self.ingestion_interval_ms = ingestion_interval_ms;
pub fn with_ingestion_rate_ms(mut self, ingestion_rate_ms: u64) -> Self {
self.ingestion_rate_ms = ingestion_rate_ms;

self
}
Expand Down
2 changes: 1 addition & 1 deletion chaindexing/src/event_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl EventHandlers {
let mut raw_query_client = config.repo.get_raw_query_client().await;

let conn = Arc::new(Mutex::new(conn));
let mut interval = interval(Duration::from_millis(config.handler_interval_ms));
let mut interval = interval(Duration::from_millis(config.handler_rate_ms));
let event_handlers_by_event_abi =
Contracts::get_all_event_handlers_by_event_abi(&config.contracts);

Expand Down
2 changes: 1 addition & 1 deletion chaindexing/src/events_ingester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl EventsIngester {
let raw_query_client = config.repo.get_raw_query_client().await;

let contracts = config.contracts.clone();
let mut interval = interval(Duration::from_millis(config.ingestion_interval_ms));
let mut interval = interval(Duration::from_millis(config.ingestion_rate_ms));

loop {
interval.tick().await;
Expand Down

0 comments on commit 2c65f9f

Please sign in to comment.