Commit c528e5f7 authored by Kati Paizee's avatar Kati Paizee

Merge branch 'hchouraria-docs-rake-tasks-job-log-artifacts-model-delete' into 'master'

Use find_each for better performance

See merge request gitlab-org/gitlab!70556
parents e67d5444 7b859843
...@@ -286,7 +286,7 @@ To delete these references to missing local artifacts (`job.log` files): ...@@ -286,7 +286,7 @@ To delete these references to missing local artifacts (`job.log` files):
```ruby ```ruby
artifacts_deleted = 0 artifacts_deleted = 0
::Ci::JobArtifact.all.each do |artifact| ### Iterate artifacts ::Ci::JobArtifact.find_each do |artifact| ### Iterate artifacts
# next if artifact.file.filename != "job.log" ### Uncomment if only `job.log` files' references are to be processed # next if artifact.file.filename != "job.log" ### Uncomment if only `job.log` files' references are to be processed
next if artifact.file.exists? ### Skip if the file reference is valid next if artifact.file.exists? ### Skip if the file reference is valid
artifacts_deleted += 1 artifacts_deleted += 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment