diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-05-24 18:18:13 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-05-24 18:18:13 +0000 |
commit | 22139d81cb440fd9c6158d92a37a3944e6bdf556 (patch) | |
tree | c9be3e0899d38fed5d084e99ac569fa697e51d0e /app/services | |
parent | 063ccb3ed4385387a4bc99dbebd5973ee9903ef8 (diff) | |
parent | cf996685bebd9ce33980b3f7b060609bb9583649 (diff) | |
download | gitlab-ce-22139d81cb440fd9c6158d92a37a3944e6bdf556.tar.gz |
Merge branch 'dz-refactor-cluster-apps-schedule' into 'master'
Refactor code around scheduling cluster installations
See merge request gitlab-org/gitlab-ce!19108
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/clusters/applications/schedule_installation_service.rb | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/app/services/clusters/applications/schedule_installation_service.rb b/app/services/clusters/applications/schedule_installation_service.rb index eb8caa68ef7..9c5461e85e1 100644 --- a/app/services/clusters/applications/schedule_installation_service.rb +++ b/app/services/clusters/applications/schedule_installation_service.rb @@ -1,21 +1,10 @@ module Clusters module Applications class ScheduleInstallationService < ::BaseService - def execute - application_class.find_or_create_by!(cluster: cluster).try do |application| - application.make_scheduled! - ClusterInstallAppWorker.perform_async(application.name, application.id) - end - end - - private - - def application_class - params[:application_class] - end + def execute(application) + application.make_scheduled! - def cluster - params[:cluster] + ClusterInstallAppWorker.perform_async(application.name, application.id) end end end |