Class: Serverkit::Actions::Check

Inherits:
Base
  • Object
show all
Defined in:
lib/serverkit/actions/check.rb

Instance Method Summary collapse

Methods inherited from Base

#call, #initialize

Constructor Details

This class inherits a constructor from Serverkit::Actions::Base

Instance Method Details

#runObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/serverkit/actions/check.rb', line 7

def run
  backends.map do |backend|
    Thread.new do
      recipe.resources.map(&:dup).each do |resource|
        resource.backend = backend
        result = resource.check ? "OK" : "NG"
        puts "[ #{result} ] #{resource.id} on #{host_for(backend)}"
      end
    end
  end.each(&:join)
end