refactor(drainer): change logic for trimming the stream and refactor for modularity (#3128)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Kartikeya Hegde
2024-01-08 18:12:13 +05:30
committed by GitHub
parent 3cd74966b2
commit de7a607e66
12 changed files with 636 additions and 486 deletions

View File

@ -15,11 +15,6 @@ async fn main() -> DrainerResult<()> {
let store = services::Store::new(&conf, false).await;
let store = std::sync::Arc::new(store);
let number_of_streams = store.config.drainer_num_partitions;
let max_read_count = conf.drainer.max_read_count;
let shutdown_intervals = conf.drainer.shutdown_interval;
let loop_interval = conf.drainer.loop_interval;
#[cfg(feature = "vergen")]
println!("Starting drainer (Version: {})", router_env::git_tag!());
@ -32,14 +27,7 @@ async fn main() -> DrainerResult<()> {
logger::debug!(startup_config=?conf);
logger::info!("Drainer started [{:?}] [{:?}]", conf.drainer, conf.log);
start_drainer(
store.clone(),
number_of_streams,
max_read_count,
shutdown_intervals,
loop_interval,
)
.await?;
start_drainer(store.clone(), conf.drainer).await?;
Ok(())
}