diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-10-20 17:14:31 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-10-20 17:14:31 +0800 |
commit | e5de4c77acbc128d1e8b8a0c3e469542ead8202f (patch) | |
tree | b78b8a994814f5edb82011ab6641837b6d516eb8 /app/workers | |
parent | cefc7eb15bd7526a7c40fc0a1ca3534c2a12a0ef (diff) | |
parent | b5cee66612fca4f1fb9791f1c8615039d1703df3 (diff) | |
download | gitlab-ce-e5de4c77acbc128d1e8b8a0c3e469542ead8202f.tar.gz |
Merge remote-tracking branch 'upstream/master' into pipeline-notifications
* upstream/master: (221 commits)
Differentiate the expire from leave event
Use LabelsFinder on Fogbuz importer
Use LabelsFinder on Google Code importer
Change the order of tested methods in project_members_controller_spec
Remove show_menu_above attribute from issuable dropdowns.
Spaces before `}`!
Avoid touch label links that does not belongs to project when moving it
Remove order by label type on LabelsFinder
Rename Labels::CreateService to Labels::FindOrCreateService
Add self.project_foreign_key on both Issue and MergeRequest
Only show label type for projects that belong to a group
Disable subscribing to group-level labels
Remove unused method Project#all_labels
Update specs to cope with new label types and priorities
Fix max number of permitted priorities per project label
Fix GitHub importer spec
Update CHANGELOG
Add support to group labels to SlashCommands::InterpretService
Use join instead of subquery on Label.unprioritized scope
Warn user deleting a group label affect all projects within the group
...
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/expire_build_instance_artifacts_worker.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/workers/expire_build_instance_artifacts_worker.rb b/app/workers/expire_build_instance_artifacts_worker.rb index 916c2e633c1..d9e2cc37bb3 100644 --- a/app/workers/expire_build_instance_artifacts_worker.rb +++ b/app/workers/expire_build_instance_artifacts_worker.rb @@ -2,10 +2,14 @@ class ExpireBuildInstanceArtifactsWorker include Sidekiq::Worker def perform(build_id) - build = Ci::Build.with_expired_artifacts.reorder(nil).find_by(id: build_id) - return unless build + build = Ci::Build + .with_expired_artifacts + .reorder(nil) + .find_by(id: build_id) - Rails.logger.info "Removing artifacts build #{build.id}..." + return unless build.try(:project) + + Rails.logger.info "Removing artifacts for build #{build.id}..." build.erase_artifacts! end end |