debian-mirror-gitlab/app/services/clusters/applications/schedule_installation_service.rb
2018-03-17 18:26:18 +05:30

22 lines
497 B
Ruby

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 cluster
params[:cluster]
end
end
end
end