aboutsummaryrefslogtreecommitdiff
path: root/qc_app/jobs.py
diff options
context:
space:
mode:
Diffstat (limited to 'qc_app/jobs.py')
-rw-r--r--qc_app/jobs.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/qc_app/jobs.py b/qc_app/jobs.py
index a8257a3..f5e5173 100644
--- a/qc_app/jobs.py
+++ b/qc_app/jobs.py
@@ -32,17 +32,24 @@ def initialise_job(# pylint: disable=[too-many-arguments]
redis_conn.expire(name=the_job["job_id"], time=timedelta(seconds=ttl_seconds))
return the_job
-def build_file_verification_job(
- redis_conn: Redis, filepath: str, filetype: str, redisurl: str,
+def build_file_verification_job(#pylint: disable=[too-many-arguments]
+ redis_conn: Redis,
+ dburi: str,
+ redisuri: str,
+ speciesid: int,
+ filepath: str,
+ filetype: str,
ttl_seconds: int):
"Build a file verification job"
- job_id = str(uuid4())
+ jobid = str(uuid4())
command = [
- sys.executable, "-m", "scripts.validate_file", filetype, filepath, redisurl,
- job_id
+ sys.executable, "-m", "scripts.validate_file",
+ dburi, redisuri, jobid,
+ "--redisexpiry", str(ttl_seconds),
+ str(speciesid), filetype, filepath,
]
return initialise_job(
- redis_conn, job_id, command, "file-verification", ttl_seconds, {
+ redis_conn, jobid, command, "file-verification", ttl_seconds, {
"filetype": filetype,
"filename": os.path.basename(filepath), "percent": 0
})