From c7ff9222b74402e068630352ba37de0f15d07b88 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 3 Dec 2024 11:18:14 -0600 Subject: Pass the redis connection and fully qualified job id Pass the redis connection on to the function used to build main since it might need to use a connection to redis. Also pass the computed fully qualified job id rather than recomputing it every time. Update dependent functions to take the new arguments. --- scripts/rqtl2/entry.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts/rqtl2/entry.py') diff --git a/scripts/rqtl2/entry.py b/scripts/rqtl2/entry.py index 48d89fb..327ed2c 100644 --- a/scripts/rqtl2/entry.py +++ b/scripts/rqtl2/entry.py @@ -16,7 +16,10 @@ from scripts.redis_logger import setup_redis_logger def build_main( args: Namespace, - run_fn: Callable[[Connection, Namespace, logging.Logger], int], + run_fn: Callable[ + [Redis, Connection, str, Namespace, logging.Logger], + int + ], loggername: str ) -> Callable[[],int]: """Build a function to be used as an entry-point for scripts.""" @@ -45,7 +48,7 @@ def build_main( logger.error("File not found: '%s'.", args.rqtl2bundle) return 2 - returncode = run_fn(dbconn, args, logger) + returncode = run_fn(rconn, dbconn, fqjobid, args, logger) if returncode == 0: rconn.hset(fqjobid, "status", "completed:success") return returncode -- cgit v1.2.3