Need to reset error if success.

This commit is contained in:
Josh Santos 2024-03-31 18:59:15 -04:00
parent 1a90a625d4
commit 40564ac1e5
No known key found for this signature in database
GPG Key ID: F40E8260EF912E41
3 changed files with 3 additions and 0 deletions

View File

@ -23,6 +23,7 @@ if __name__ == '__main__':
while (time.time() - start_time) < args.timeout: while (time.time() - start_time) < args.timeout:
try: try:
conn = psycopg2.connect(user=args.db_user, host=args.db_host, port=args.db_port, password=args.db_password, dbname=args.db_name) conn = psycopg2.connect(user=args.db_user, host=args.db_host, port=args.db_port, password=args.db_password, dbname=args.db_name)
error = ''
conn.close() conn.close()
break break
except psycopg2.OperationalError as e: except psycopg2.OperationalError as e:

View File

@ -23,6 +23,7 @@ if __name__ == '__main__':
while (time.time() - start_time) < args.timeout: while (time.time() - start_time) < args.timeout:
try: try:
conn = psycopg2.connect(user=args.db_user, host=args.db_host, port=args.db_port, password=args.db_password, dbname=args.db_name) conn = psycopg2.connect(user=args.db_user, host=args.db_host, port=args.db_port, password=args.db_password, dbname=args.db_name)
error = ''
conn.close() conn.close()
break break
except psycopg2.OperationalError as e: except psycopg2.OperationalError as e:

View File

@ -23,6 +23,7 @@ if __name__ == '__main__':
while (time.time() - start_time) < args.timeout: while (time.time() - start_time) < args.timeout:
try: try:
conn = psycopg2.connect(user=args.db_user, host=args.db_host, port=args.db_port, password=args.db_password, dbname=args.db_name) conn = psycopg2.connect(user=args.db_user, host=args.db_host, port=args.db_port, password=args.db_password, dbname=args.db_name)
error = ''
conn.close() conn.close()
break break
except psycopg2.OperationalError as e: except psycopg2.OperationalError as e: