Module: Staypuft::Concerns::HostOrchestrationBuildHook

Extended by:
ActiveSupport::Concern
Defined in:
app/models/staypuft/concerns/host_orchestration_build_hook.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.cache_id(host_id) ⇒ Object



18
19
20
# File 'app/models/staypuft/concerns/host_orchestration_build_hook.rb', line 18

def self.cache_id(host_id)
  "host.#{host_id}.wake_up_orchestration"
end

Instance Method Details

#wake_up_orchestrationObject



10
11
12
13
14
15
16
# File 'app/models/staypuft/concerns/host_orchestration_build_hook.rb', line 10

def wake_up_orchestration
  key = HostOrchestrationBuildHook.cache_id(id)
  ids = Rails.cache.read(key)
  Rails.cache.delete key
  ForemanTasks.dynflow.world.event *ids.values_at(:execution_plan_id, :step_id),
                                   installed_at: installed_at
end