aboutsummaryrefslogtreecommitdiff
path: root/qc_app/jobs.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-07-07 13:07:55 +0300
committerFrederick Muriuki Muriithi2022-07-07 13:07:55 +0300
commitb367d04c57b21c0a9e2da22e8b20404de076768d (patch)
tree85e58879965fc2da1d90dd0a39a30732bcb8ffc2 /qc_app/jobs.py
parent23a5e2c8dc2cbbf1ce55c22f80519824e413b883 (diff)
downloadgn-uploader-b367d04c57b21c0a9e2da22e8b20404de076768d.tar.gz
Add filetype details to database update code
The filetype determines the queries to be run to update the database, therefore, this commit adds filetype information.
Diffstat (limited to 'qc_app/jobs.py')
-rw-r--r--qc_app/jobs.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/qc_app/jobs.py b/qc_app/jobs.py
index 4e6a11e..275f9c8 100644
--- a/qc_app/jobs.py
+++ b/qc_app/jobs.py
@@ -20,7 +20,8 @@ def launch_job(# pylint: disable=[too-many-arguments]
"python3", "-m", "scripts.worker", filetype, filepath, redisurl, job_id]
the_job = {
"job_id": job_id, "command": shlex.join(command), "status": "pending",
- "filename": os.path.basename(filepath), "percent": 0
+ "filename": os.path.basename(filepath), "percent": 0,
+ "filetype": filetype
}
redis_conn.hset(name=the_job["job_id"], mapping=the_job)
redis_conn.expire(name=the_job["job_id"], time=timedelta(seconds=ttl_seconds))