diff --git a/chaindexing/src/config.rs b/chaindexing/src/config.rs index e0b42d3..321f1a7 100644 --- a/chaindexing/src/config.rs +++ b/chaindexing/src/config.rs @@ -24,8 +24,8 @@ pub struct Config { pub contracts: Vec, 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, } @@ -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, } } @@ -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 } diff --git a/chaindexing/src/event_handlers.rs b/chaindexing/src/event_handlers.rs index a905b63..01e455e 100644 --- a/chaindexing/src/event_handlers.rs +++ b/chaindexing/src/event_handlers.rs @@ -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); diff --git a/chaindexing/src/events_ingester.rs b/chaindexing/src/events_ingester.rs index 7d68231..b51c437 100644 --- a/chaindexing/src/events_ingester.rs +++ b/chaindexing/src/events_ingester.rs @@ -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;