lib/capistrano/configuration/connections.rb
# Ensures that there are active sessions for each server in the list.
Ensures that there are active sessions for each server in the list.
Ensures that there are active sessions for each server in the list .
def establish_connections_to(servers)
        failed_servers = []
        connection_factory
        threads = Array(servers).map { |server| establish_connection_to(server, failed_servers) }
        threads.each { |t| t.join }
        if failed_servers.any?
          errors = failed_servers.map { |h| "#{h[:server]} (#{h[:error].class}: #{h[:error].message})" }
          error = ConnectionError.new("connection failed for: #{errors.join(', ')}")
          error.hosts = failed_servers.map { |h| h[:server] }
          raise error
        end
      end
def establish_connections_to ( servers ) failed_servers = [ ] connection_factory threads = Array ( servers ) . map { | server | establish_connection_to ( server , failed_servers ) } threads . each { | t | t . join } if failed_servers . any? errors = failed_servers . map { | h | "#{h[:server]} (#{h[:error].class}: #{h[:error].message})" } error = ConnectionError . new ( "connection failed for: #{errors.join(', ')}" ) error . hosts = failed_servers . map { | h | h [ :server ] } raise error end end
Ensures that there are active sessions for each server in the list.
Ensures that there are active sessions for each server in the list .
# force the connection factory to be instantiated synchronously, # otherwise we wind up with multiple gateway instances, because # each connection is done in parallel.
servers
<not_specific>