From 139555a46ee4458f5dff79dfd073621cd1936cc1 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Fri, 1 Sep 2023 16:27:17 +0200 Subject: [PATCH] liquidator: Make the check interval configurable (#702) And reduce the default from 5s to 1s. --- bin/liquidator/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/liquidator/src/main.rs b/bin/liquidator/src/main.rs index 1db2e8e86..2fb5808f6 100644 --- a/bin/liquidator/src/main.rs +++ b/bin/liquidator/src/main.rs @@ -79,6 +79,9 @@ struct Cli { #[clap(long, env)] liqor_owner: String, + #[clap(long, env, default_value = "1000")] + check_interval_ms: u64, + #[clap(long, env, default_value = "300")] snapshot_interval_secs: u64, @@ -422,8 +425,7 @@ async fn main() -> anyhow::Result<()> { }); let liquidation_job = tokio::spawn({ - // TODO: configurable interval - let mut interval = tokio::time::interval(Duration::from_secs(5)); + let mut interval = tokio::time::interval(Duration::from_millis(cli.check_interval_ms)); let shared_state = shared_state.clone(); async move { loop {