Skip to content

Skip expire_at correction query if there are no artifacts

drew stachon requested to merge skip-empty-query-in-destroy-batch-service into master

What does this MR do and why?

This MR adds a condition to an existing guard in the JobArtifacts::DestroyBatcService.

If there are no artifacts to Destroy, i.e. all the artifacts have been cleaned up on an instance and there is nothing new to clear out, we don't need to repeatedly fire a WHERE 1=0 query to the database.

I switched the guard from a return unless to an if so the conjunctive condition would be easier to read.

How to set up and validate locally

Run the tests. We have good coverage around artifacts removal and can lean on them to make sure we're not changing any removal behavior.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading