Use FastDestroyAll for destroying job artifacts

Currently, the Build -> JobArtifact relation is defined as

has_many :job_artifacts, class_name: 'Ci::JobArtifact', foreign_key: :job_id, dependent: :destroy, inverse_of: :job # rubocop:disable Cop/ActiveRecordDependent

We should use FastDestroyAll for destroying artifacts instead. The object storage files should be destroyed in a background worker.

Assignee Loading
Time tracking Loading