refactor(drainer): removed router dependency from drainer (#209)

This commit is contained in:
Abhishek
2022-12-23 15:11:06 +05:30
committed by GitHub
parent 7274fd70c6
commit c9276a30d7
11 changed files with 252 additions and 43 deletions

View File

@ -1,5 +1,4 @@
use drainer::{errors::DrainerResult, start_drainer};
use router::configs::settings;
use drainer::{errors::DrainerResult, services, settings, start_drainer};
use structopt::StructOpt;
#[tokio::main]
@ -8,13 +7,13 @@ async fn main() -> DrainerResult<()> {
let cmd_line = settings::CmdLineConf::from_args();
let conf = settings::Settings::with_config_path(cmd_line.config_path).unwrap();
let store = router::services::Store::new(&conf, false).await;
let store = services::Store::new(&conf, false).await;
let store = std::sync::Arc::new(store);
let number_of_drainers = conf.drainer.num_partitions;
let number_of_streams = store.config.drainer_num_partitions;
let max_read_count = conf.drainer.max_read_count;
start_drainer(store, number_of_drainers, max_read_count).await?;
start_drainer(store, number_of_streams, max_read_count).await?;
Ok(())
}