Allow the connection timeout to be configured on a per-server basis. Fixes #3388

This commit is contained in:
Akshay Joshi
2018-06-19 19:58:46 -04:00
committed by Dave Page
parent 9821e28da5
commit 7a06acb678
14 changed files with 138 additions and 13 deletions

View File

@@ -240,7 +240,15 @@ def create_maintenance_job(sid, did):
cmd=utility, args=args
)
manager.export_password_env(p.id)
p.set_env_variables(server)
# Check for connection timeout and if it is greater than 0 then
# set the environment variable PGCONNECT_TIMEOUT.
if manager.connect_timeout > 0:
env = dict()
env['PGCONNECT_TIMEOUT'] = str(manager.connect_timeout)
p.set_env_variables(server, env=env)
else:
p.set_env_variables(server)
p.start()
jid = p.id
except Exception as e: