aboutsummaryrefslogtreecommitdiff
path: root/qc_app/parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'qc_app/parse.py')
-rw-r--r--qc_app/parse.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/qc_app/parse.py b/qc_app/parse.py
index 40f7b44..d9be993 100644
--- a/qc_app/parse.py
+++ b/qc_app/parse.py
@@ -82,7 +82,7 @@ def parse():
def parse_status(job_id: str):
"Retrieve the status of the job"
with Redis.from_url(app.config["REDIS_URL"], decode_responses=True) as rconn:
- job = jobs.job(rconn, job_id)
+ job = jobs.job(rconn, jobs.jobsnamespace(), job_id)
if job:
error_filename = jobs.error_filename(
@@ -122,7 +122,7 @@ def parse_status(job_id: str):
def results(job_id: str):
"""Show results of parsing..."""
with Redis.from_url(app.config["REDIS_URL"], decode_responses=True) as rconn:
- job = jobs.job(rconn, job_id)
+ job = jobs.job(rconn, jobs.jobsnamespace(), job_id)
if job:
filename = job["filename"]
@@ -143,7 +143,7 @@ def results(job_id: str):
def fail(job_id: str):
"""Handle parsing failure"""
with Redis.from_url(app.config["REDIS_URL"], decode_responses=True) as rconn:
- job = jobs.job(rconn, job_id)
+ job = jobs.job(rconn, jobs.jobsnamespace(), job_id)
if job:
error_filename = jobs.error_filename(
@@ -164,9 +164,11 @@ def abort():
job_id = request.form["job_id"]
with Redis.from_url(app.config["REDIS_URL"], decode_responses=True) as rconn:
- job = jobs.job(rconn, job_id)
+ job = jobs.job(rconn, jobs.jobsnamespace(), job_id)
if job:
- rconn.hset(name=job_id, key="user_aborted", value=int(True))
+ rconn.hset(name=jobs.job_key(jobs.jobsnamespace(), job_id),
+ key="user_aborted",
+ value=int(True))
return redirect(url_for("parse.parse_status", job_id=job_id))