mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-31 01:57:45 +08:00
feat: Add graceful shutdown in drainer (#498)
This commit is contained in:
@ -18,12 +18,19 @@ async fn main() -> DrainerResult<()> {
|
||||
|
||||
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 _guard = logger::setup(&conf.log).change_context(errors::DrainerError::MetricsError)?;
|
||||
|
||||
logger::info!("Drainer started [{:?}] [{:?}]", conf.drainer, conf.log);
|
||||
|
||||
start_drainer(store.clone(), number_of_streams, max_read_count).await?;
|
||||
start_drainer(
|
||||
store.clone(),
|
||||
number_of_streams,
|
||||
max_read_count,
|
||||
shutdown_intervals,
|
||||
)
|
||||
.await?;
|
||||
|
||||
store.close().await;
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user