uploads: mark uploads as failed if they're stuck processing for more than 4 hours.

This commit is contained in:
evazion
2022-11-20 23:34:18 -06:00
parent 570d6a9d01
commit ba1cf14c7e
6 changed files with 47 additions and 0 deletions

View File

@@ -51,6 +51,12 @@ class MediaAsset < ApplicationRecord
before_create :initialize_file_key
scope :expired, -> { processing.where(created_at: ..4.hours.ago) }
def self.prune!
expired.update_all(status: :failed)
end
class Variant
extend Memoist
include ActiveModel::Serializers::JSON