aboutsummaryrefslogtreecommitdiff
path: root/qc_app/jobs.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-12-18 12:01:38 +0300
committerFrederick Muriuki Muriithi2023-12-18 12:01:38 +0300
commitd4e45e5bf9877957c36b8e0a537ba3819a674614 (patch)
tree1850dbe6d2733497501db09e22f9f53daa0f9943 /qc_app/jobs.py
parent096ab99a2d961e864f340c39252b4c8eecc72191 (diff)
downloadgn-uploader-d4e45e5bf9877957c36b8e0a537ba3819a674614.tar.gz
Samples: Hook-up external async script to upload the samples.
Diffstat (limited to 'qc_app/jobs.py')
-rw-r--r--qc_app/jobs.py6
1 files changed, 3 insertions, 3 deletions
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