diff options
author | Frederick Muriuki Muriithi | 2024-01-20 09:57:23 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-01-20 09:57:23 +0300 |
commit | cdd4dc456e56bb4eb055e1cb7f2518d45fb3bfb9 (patch) | |
tree | 73248acbadd5014f2b26da41da3098f1ac5ecc1e /qc_app/jobs.py | |
parent | 53b1e7cb181380a24aab4cbc7a9634b2d8dd2d29 (diff) | |
download | gn-uploader-cdd4dc456e56bb4eb055e1cb7f2518d45fb3bfb9.tar.gz |
Fetch sample/case names from database
Fetch the sample/case names from the database rather than from a
static file in the repository.
Issue:
https://issues.genenetwork.org/issues/quality-control/read-samples-from-database-by-species
Diffstat (limited to 'qc_app/jobs.py')
-rw-r--r-- | qc_app/jobs.py | 19 |
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 }) |