cleanup: do not count rows unless enabled by argument "--count-rows"

This commit is contained in:
GroovieGermanikus 2024-02-26 14:06:35 +01:00
parent 1515ee2119
commit 44568a5d9e
No known key found for this signature in database
GPG Key ID: 5B6EB831A5CD2015
1 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,9 @@ pub struct Args {
#[arg(short, long, default_value_t = false)]
pub dry_run: bool,
#[arg(short, long, default_value_t = false)]
pub count_rows: bool,
}
#[tokio::main()]
@ -22,9 +25,10 @@ async fn main() {
let Args {
num_slots_to_keep,
dry_run,
count_rows,
} = Args::parse();
let session = PostgresSession::new(0).await.unwrap();
session.cleanup_old_data(num_slots_to_keep, dry_run).await;
session.cleanup_old_data(num_slots_to_keep, dry_run, count_rows).await;
}