aboutsummaryrefslogtreecommitdiff
path: root/qc_app/__init__.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-04-26 15:18:26 +0300
committerFrederick Muriuki Muriithi2022-04-26 15:18:26 +0300
commitea70b7a7db42d51fa7f22f3dcb6d2aca6d8a795d (patch)
treef4dc7e29b8e49a1cbf2412d0bcab55294957e021 /qc_app/__init__.py
parente6895f5bac672d2e1d2a04fe8118fa55c3a40b91 (diff)
downloadgn-uploader-ea70b7a7db42d51fa7f22f3dcb6d2aca6d8a795d.tar.gz
Fix issues caught processing the jobs
* Create and push the application context for the worker functions * Fix the update of meta fields
Diffstat (limited to 'qc_app/__init__.py')
-rw-r--r--qc_app/__init__.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/qc_app/__init__.py b/qc_app/__init__.py
index 35cc422..7f423c2 100644
--- a/qc_app/__init__.py
+++ b/qc_app/__init__.py
@@ -7,6 +7,16 @@ from flask import Flask
from .entry import entrybp
from .parse import parsebp
+def instance_path():
+ """Retrieve the `instance_path`. Raise an exception if not defined."""
+ path = os.getenv("QCAPP_INSTANCE_PATH", None)
+ if path is None:
+ raise Exception((
+ "Configuration Error: Set the `QCAPP_INSTANCE_PATH` environment "
+ "variable."))
+
+ return path
+
def create_app(instance_path):
"""The application factory"""
app = Flask(