Add age/expiry duration constants to BulkImport
class (#32839)
This commit is contained in:
parent
897cb1803e
commit
5d9dde3ec0
3 changed files with 56 additions and 2 deletions
|
@ -9,10 +9,16 @@ class Vacuum::ImportsVacuum
|
|||
private
|
||||
|
||||
def clean_unconfirmed_imports!
|
||||
BulkImport.state_unconfirmed.where(created_at: ..10.minutes.ago).in_batches.delete_all
|
||||
BulkImport
|
||||
.confirmation_missed
|
||||
.in_batches
|
||||
.delete_all
|
||||
end
|
||||
|
||||
def clean_old_imports!
|
||||
BulkImport.where(created_at: ..1.week.ago).in_batches.delete_all
|
||||
BulkImport
|
||||
.archival_completed
|
||||
.in_batches
|
||||
.delete_all
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue