summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-13 15:08:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-13 15:08:52 +0000
commit0ab47b994caa80c5587f33dc818626b66cfdafe2 (patch)
tree5ef3976d2f84e3368903a67ba2dbd87a74b9a43c /app/workers
parent1308dc5eb484ab0f8064989fc551ebdb4b1a7976 (diff)
downloadgitlab-ce-0ab47b994caa80c5587f33dc818626b66cfdafe2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/cleanup_container_repository_worker.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/workers/cleanup_container_repository_worker.rb b/app/workers/cleanup_container_repository_worker.rb
index 83fb3e58d29..83397a1dda2 100644
--- a/app/workers/cleanup_container_repository_worker.rb
+++ b/app/workers/cleanup_container_repository_worker.rb
@@ -11,6 +11,7 @@ class CleanupContainerRepositoryWorker
def perform(current_user_id, container_repository_id, params)
@current_user = User.find_by_id(current_user_id)
@container_repository = ContainerRepository.find_by_id(container_repository_id)
+ @params = params
return unless valid?
@@ -22,9 +23,15 @@ class CleanupContainerRepositoryWorker
private
def valid?
+ return true if run_by_container_expiration_policy?
+
current_user && container_repository && project
end
+ def run_by_container_expiration_policy?
+ @params['container_expiration_policy'] && container_repository && project
+ end
+
def project
container_repository&.project
end