Skip to content
Snippets Groups Projects
Commit 21bc7359 authored by Kassio Borges's avatar Kassio Borges :three:
Browse files

Ensure to run all rails logic when deleting pages deployments

The usage of `delete_all` caused problems in the past where the
operation wasn't deleting the deployment files.

To ensure we're calling all rails callbacks while deleting pages
deployments, it's better to use `destroy!`.

Related to: #457159
parent 4e5079e9
No related branches found
No related tags found
2 merge requests!158455Backport Release Environments notification pipeline change to 16.11,!151584Ensure to run all rails logic when deleting pages deployments
......@@ -12,8 +12,7 @@ class DeactivatedDeploymentsDeleteCronWorker
def perform
PagesDeployment.deactivated.each_batch do |deployments|
deployments.each { |deployment| deployment.file.remove! }
deployments.delete_all
deployments.each(&:destroy!)
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment