diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /app/services/clusters/cleanup/app_service.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) | |
download | gitlab-ce-a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4.tar.gz |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'app/services/clusters/cleanup/app_service.rb')
-rw-r--r-- | app/services/clusters/cleanup/app_service.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/app/services/clusters/cleanup/app_service.rb b/app/services/clusters/cleanup/app_service.rb deleted file mode 100644 index a7e29c78ea0..00000000000 --- a/app/services/clusters/cleanup/app_service.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -module Clusters - module Cleanup - class AppService < Clusters::Cleanup::BaseService - def execute - persisted_applications = @cluster.persisted_applications - - persisted_applications.each do |app| - next unless app.available? - next unless app.can_uninstall? - - log_event(:uninstalling_app, application: app.class.application_name) - uninstall_app_async(app) - end - - # Keep calling the worker untill all dependencies are uninstalled - return schedule_next_execution(Clusters::Cleanup::AppWorker) if persisted_applications.any? - - log_event(:schedule_remove_project_namespaces) - cluster.continue_cleanup! - end - - private - - def uninstall_app_async(application) - application.make_scheduled! - - Clusters::Applications::UninstallWorker.perform_async(application.name, application.id) - end - end - end -end |