diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-05-23 15:49:39 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-05-24 12:31:36 +0300 |
commit | cf996685bebd9ce33980b3f7b060609bb9583649 (patch) | |
tree | be3bebfd2260f592c468cb7afa6be6109747f0e8 /app/services/clusters | |
parent | cf7f3606d3bca3dfb481323aaa4f3dc50ca1a089 (diff) |
Refactor code around scheduling cluster installations
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/services/clusters')
-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 |