liquidator: Make the check interval configurable (#702)

And reduce the default from 5s to 1s.
This commit is contained in:
Christian Kamm 2023-09-01 16:27:17 +02:00 committed by GitHub
parent aca2b2e679
commit 139555a46e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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 {