mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Added in an accelerate connection timeout setting
This commit is contained in:
parent
59a5ce23d9
commit
d317103371
2 changed files with 3 additions and 1 deletions
|
@ -103,7 +103,7 @@ class Connection(object):
|
|||
# TODO: make the timeout and retries configurable?
|
||||
tries = 3
|
||||
self.conn = socket.socket()
|
||||
self.conn.settimeout(self.runner.accelerate_timeout)
|
||||
self.conn.settimeout(constants.ACCELERATE_CONNECT_TIMEOUT)
|
||||
vvvv("attempting connection to %s via the accelerated port %d" % (self.host,self.accport))
|
||||
while tries > 0:
|
||||
try:
|
||||
|
@ -116,6 +116,7 @@ class Connection(object):
|
|||
if tries == 0:
|
||||
vvv("Could not connect via the accelerated connection, exceeded # of tries")
|
||||
raise errors.AnsibleError("Failed to connect")
|
||||
self.conn.settimeout(self.runner.accelerate_timeout)
|
||||
except:
|
||||
if allow_ssh:
|
||||
vvv("Falling back to ssh to startup accelerated mode")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue