diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 18:08:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 18:08:52 +0300 |
commit | 0ab47b994caa80c5587f33dc818626b66cfdafe2 (patch) | |
tree | 5ef3976d2f84e3368903a67ba2dbd87a74b9a43c /app/workers/cleanup_container_repository_worker.rb | |
parent | 1308dc5eb484ab0f8064989fc551ebdb4b1a7976 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers/cleanup_container_repository_worker.rb')
-rw-r--r-- | app/workers/cleanup_container_repository_worker.rb | 7 |
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 |