diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /app/workers/cleanup_container_repository_worker.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/workers/cleanup_container_repository_worker.rb')
-rw-r--r-- | app/workers/cleanup_container_repository_worker.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/workers/cleanup_container_repository_worker.rb b/app/workers/cleanup_container_repository_worker.rb index 4469ea8cff9..80cc296fff5 100644 --- a/app/workers/cleanup_container_repository_worker.rb +++ b/app/workers/cleanup_container_repository_worker.rb @@ -16,9 +16,17 @@ class CleanupContainerRepositoryWorker # rubocop:disable Scalability/IdempotentW return unless valid? - Projects::ContainerRepository::CleanupTagsService + if run_by_container_expiration_policy? + container_repository.start_expiration_policy! + end + + result = Projects::ContainerRepository::CleanupTagsService .new(project, current_user, params) .execute(container_repository) + + if run_by_container_expiration_policy? && result[:status] == :success + container_repository.reset_expiration_policy_started_at! + end end private @@ -30,7 +38,7 @@ class CleanupContainerRepositoryWorker # rubocop:disable Scalability/IdempotentW end def run_by_container_expiration_policy? - @params['container_expiration_policy'] && container_repository && project + @params['container_expiration_policy'] && container_repository.present? && project.present? end def project |