Implemented force exit on connection failure

This commit is contained in:
d3ad0ne
2025-09-09 17:37:36 +03:00
parent 95a232fb78
commit 523ac2228d

View File

@ -17,6 +17,7 @@ def set_connection():
logger.info('Connection to PostreSQL DB set successfully') logger.info('Connection to PostreSQL DB set successfully')
except psycopg2.Error as e: except psycopg2.Error as e:
logger.error(f'Failed to set connection to the PostgreSQL DB: {e.pgerror}') logger.error(f'Failed to set connection to the PostgreSQL DB: {e.pgerror}')
exit()
def close_connection(connection): def close_connection(connection):