From cdd4dc456e56bb4eb055e1cb7f2518d45fb3bfb9 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Sat, 20 Jan 2024 09:57:23 +0300 Subject: 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 --- qc_app/jobs.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'qc_app/jobs.py') 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 }) -- cgit v1.2.3