instance method
execute
Ruby on Rails 2.6.1
Since v1.9.3 Last seen in v2.11.0Signature
execute()
No documentation comment.
Source
# File lib/kamal/sshkit_with_ext.rb, line 115
def execute
threads = hosts.map do |host|
Thread.new(host) do |h|
backend(h, &block).run
rescue ::StandardError => e
e2 = SSHKit::Runner::ExecuteError.new e
raise e2, "Exception while executing #{host.user ? "as #{host.user}@" : "on host "}#{host}: #{e.message}"
end
end
exceptions = []
threads.each do |t|
begin
t.join
rescue SSHKit::Runner::ExecuteError => e
exceptions << e
end
end
if exceptions.one?
raise exceptions.first
elsif exceptions.many?
raise exceptions.first, [ "Exceptions on #{exceptions.count} hosts:", exceptions.map(&:message) ].join("\n")
end
end
Defined in lib/kamal/sshkit_with_ext.rb line 115
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in SSHKit::Runner::Parallel::CompleteAll