aboutsummaryrefslogtreecommitdiff
path: root/wsgi.py
diff options
context:
space:
mode:
Diffstat (limited to 'wsgi.py')
-rw-r--r--wsgi.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/wsgi.py b/wsgi.py
index baf6ce5..40c4473 100644
--- a/wsgi.py
+++ b/wsgi.py
@@ -1,8 +1,19 @@
"""Run the application"""
from qc_app import create_app, instance_path
+from qc_app.check_connections import check_db, check_redis
-app = create_app(instance_path())
+def check_and_build_app():
+ # Setup the app
+ appl = create_app(instance_path())
+
+ # Check connections
+ check_db(appl.config["SQL_URI"])
+ check_redis(appl.config["REDIS_URL"])
+ return appl
+
+app = check_and_build_app()
if __name__ == "__main__":
+ # Run the app
app.run()