Remove --dry-run parameter from delete-extraneous-posts command

This commit is contained in:
silverpill 2022-08-11 23:13:07 +00:00
parent d2444826fc
commit 29402f0113

View file

@ -115,9 +115,6 @@ struct DeletePost {
#[derive(Parser)] #[derive(Parser)]
struct DeleteExtraneousPosts { struct DeleteExtraneousPosts {
days: i64, days: i64,
#[clap(long)]
dry_run: bool,
} }
/// Delete attachments that don't belong to any post /// Delete attachments that don't belong to any post
@ -249,10 +246,8 @@ async fn main() {
let created_before = Utc::now() - Duration::days(subopts.days); let created_before = Utc::now() - Duration::days(subopts.days);
let posts = find_extraneous_posts(db_client, &created_before).await.unwrap(); let posts = find_extraneous_posts(db_client, &created_before).await.unwrap();
for post_id in posts { for post_id in posts {
if !subopts.dry_run {
let deletion_queue = delete_post(db_client, &post_id).await.unwrap(); let deletion_queue = delete_post(db_client, &post_id).await.unwrap();
deletion_queue.process(&config).await; deletion_queue.process(&config).await;
};
println!("post {} deleted", post_id); println!("post {} deleted", post_id);
}; };
}, },