mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat: wait 24h before deleting cdn images
This commit is contained in:
parent
31c0253b00
commit
f1de2f2858
3 changed files with 25 additions and 5 deletions
|
|
@ -33,6 +33,23 @@ pub async fn get_by_attachment_id(
|
|||
)
|
||||
}
|
||||
|
||||
pub async fn remove_deletion_queue(pool: &PgPool, attachment_id: u64) -> anyhow::Result<()> {
|
||||
sqlx::query(
|
||||
r#"
|
||||
delete from image_cleanup_jobs
|
||||
where id in (
|
||||
select id from images
|
||||
where original_attachment_id = $1
|
||||
)
|
||||
"#,
|
||||
)
|
||||
.bind(attachment_id as i64)
|
||||
.execute(pool)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn pop_queue(
|
||||
pool: &PgPool,
|
||||
) -> anyhow::Result<Option<(Transaction<Postgres>, ImageQueueEntry)>> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue