From d4e45e5bf9877957c36b8e0a537ba3819a674614 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 18 Dec 2023 12:01:38 +0300 Subject: Samples: Hook-up external async script to upload the samples. --- qc_app/jobs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qc_app/jobs.py') diff --git a/qc_app/jobs.py b/qc_app/jobs.py index 10ba832..c5bf5e5 100644 --- a/qc_app/jobs.py +++ b/qc_app/jobs.py @@ -12,7 +12,7 @@ def error_filename(job_id, error_dir): "Compute the path of the file where errors will be dumped." return f"{error_dir}/job_{job_id}.error" -def __init_job__(# pylint: disable=[too-many-arguments] +def initialise_job(# pylint: disable=[too-many-arguments] redis_conn: Redis, job_id: str, command: list, job_type: str, ttl_seconds: int, extra_meta: dict) -> dict: "Initialise a job 'object' and put in on redis" @@ -33,7 +33,7 @@ def build_file_verification_job( sys.executable, "-m", "scripts.validate_file", filetype, filepath, redisurl, job_id ] - return __init_job__( + return initialise_job( redis_conn, job_id, command, "file-verification", ttl_seconds, { "filetype": filetype, "filename": os.path.basename(filepath), "percent": 0 @@ -48,7 +48,7 @@ def data_insertion_job(# pylint: disable=[too-many-arguments] sys.executable, "-m", "scripts.insert_data", filetype, filepath, speciesid, platformid, datasetid, databaseuri, redisuri ] - return __init_job__( + return initialise_job( redis_conn, str(uuid4()), command, "data-insertion", ttl_seconds, { "filename": os.path.basename(filepath), "filetype": filetype, "totallines": totallines -- cgit v1.2.3