Fix an issue where Backup, Restore, and Maintenance not working if connection timeout is set in the server dialog. #5959

This commit is contained in:
Akshay Joshi
2023-03-27 17:41:19 +05:30
parent 66cb4e3bcf
commit 12f82820c9
5 changed files with 6 additions and 4 deletions

View File

@@ -2251,7 +2251,7 @@ class MViewNode(ViewNode, VacuumSettings):
# Check for connection timeout and if it is greater than 0
# then set the environment variable PGCONNECT_TIMEOUT.
timeout = manager.get_connection_param_value('connect_timeout')
if timeout and timeout > 0:
if timeout and int(timeout) > 0:
env = dict()
env['PGCONNECT_TIMEOUT'] = str(timeout)
p.set_env_variables(server, env=env)

View File

@@ -406,7 +406,7 @@ def create_backup_objects_job(sid):
# Check for connection timeout and if it is greater than 0 then
# set the environment variable PGCONNECT_TIMEOUT.
timeout = manager.get_connection_param_value('connect_timeout')
if timeout and timeout > 0:
if timeout and int(timeout) > 0:
env = dict()
env['PGCONNECT_TIMEOUT'] = str(timeout)
p.set_env_variables(server, env=env)

View File

@@ -252,7 +252,7 @@ def create_maintenance_job(sid, did):
# Check for connection timeout and if it is greater than 0 then
# set the environment variable PGCONNECT_TIMEOUT.
timeout = manager.get_connection_param_value('connect_timeout')
if timeout and timeout > 0:
if timeout and int(timeout) > 0:
env = dict()
env['PGCONNECT_TIMEOUT'] = str(timeout)
p.set_env_variables(server, env=env)

View File

@@ -383,7 +383,7 @@ def create_restore_job(sid):
# Check for connection timeout and if it is greater than 0 then
# set the environment variable PGCONNECT_TIMEOUT.
timeout = manager.get_connection_param_value('connect_timeout')
if timeout and timeout > 0:
if timeout and int(timeout) > 0:
env = dict()
env['PGCONNECT_TIMEOUT'] = str(timeout)
p.set_env_variables(server, env=env)