aboutsummaryrefslogtreecommitdiff
path: root/qc_app/check_connections.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-07-25 11:07:33 -0500
committerFrederick Muriuki Muriithi2024-07-25 14:34:09 -0500
commit754e8f214b940e05298cb360ed829f5c685d55a5 (patch)
tree62c2c5b601746621f0949b38937ad232f006dee2 /qc_app/check_connections.py
parentde9e1b9fe37928b864bea28b408de6c14d04526b (diff)
downloadgn-uploader-754e8f214b940e05298cb360ed829f5c685d55a5.tar.gz
Rename module: qc_app --> uploader
Diffstat (limited to 'qc_app/check_connections.py')
-rw-r--r--qc_app/check_connections.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/qc_app/check_connections.py b/qc_app/check_connections.py
deleted file mode 100644
index ceccc32..0000000
--- a/qc_app/check_connections.py
+++ /dev/null
@@ -1,28 +0,0 @@
-"""Check the various connection used in the application"""
-import sys
-import traceback
-
-import redis
-import MySQLdb
-
-from qc_app.db_utils import database_connection
-
-def check_redis(uri: str):
- "Check the redis connection"
- try:
- with redis.Redis.from_url(uri) as rconn:
- rconn.ping()
- except redis.exceptions.ConnectionError as conn_err:
- print(conn_err, file=sys.stderr)
- print(traceback.format_exc(), file=sys.stderr)
- sys.exit(1)
-
-def check_db(uri: str):
- "Check the mysql connection"
- try:
- with database_connection(uri) as dbconn: # pylint: disable=[unused-variable]
- pass
- except MySQLdb.OperationalError as op_err:
- print(op_err, file=sys.stderr)
- print(traceback.format_exc(), file=sys.stderr)
- sys.exit(1)