Skip to content

Use `DestroyBatchService` in `Ci::Build#erase`

Currently, Ci::Build#erase uses job_artifacts.destroy_all to delete all artifacts within the build.

Given the intricacies of artifact deletion, we should avoid having multiple ways to delete a batch of artifacts and have a single service that handles this. We already have Ci::JobArtifacts::DestroyBatchService so let's use this here as well instead of destroy_all.

Edited by Erick Bajao