fix(exports): purge stuck (pending) exports, not generated or failed
Avec l'autre PR, ça reproduit le comportement d'avant, c'est à dire que quoiqu'il arrive un export est purgé : - soit 16h après sa génération (on a 16h pour le télécharger) - soit 12h après sa création, et qu'il est bloqué Auparavant, tous les exports étaient purgés au bout de 3h quelle que soit le statut.
This commit is contained in:
parent
bd788ec6bf
commit
f1957e51f8
4 changed files with 17 additions and 0 deletions
|
@ -35,6 +35,11 @@ module TransientModelsWithPurgeableJobConcern
|
|||
.where('updated_at < ?', (Time.zone.now - duration))
|
||||
}
|
||||
|
||||
scope :stuck, lambda { |duration|
|
||||
where(job_status: [job_statuses.fetch(:pending)])
|
||||
.where('updated_at < ?', (Time.zone.now - duration))
|
||||
}
|
||||
|
||||
def available?
|
||||
generated?
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue