Remove --dry-run parameter from delete-extraneous-posts command
This commit is contained in:
parent
d2444826fc
commit
29402f0113
1 changed files with 2 additions and 7 deletions
|
@ -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);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue