From bc78ac2cf926f38ef88309dd1b4288b1b1230b66 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 5 Dec 2023 16:51:47 +0300 Subject: Add missing scripts and update code to invoke them Copy the missing scripts over from GN3 and update them for gn-auth. Update the code to invoke the scripts correctly. Set up correct redis keys for use with the scripts. --- gn_auth/commands.py | 2 +- gn_auth/jobs.py | 2 +- gn_auth/settings.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'gn_auth') diff --git a/gn_auth/commands.py b/gn_auth/commands.py index 02bed10..cf79041 100644 --- a/gn_auth/commands.py +++ b/gn_auth/commands.py @@ -64,5 +64,5 @@ def run_async_cmd( """A utility function to call `gn3.commands.queue_cmd` function and run the worker in the `one-shot` mode.""" cmd_id = queue_cmd(conn, job_queue, cmd, email, env) - subprocess.Popen([f"{sys.executable}", "-m", "sheepdog.worker"]) # pylint: disable=[consider-using-with] + subprocess.Popen([f"{sys.executable}", "-m", "scripts.worker", job_queue]) # pylint: disable=[consider-using-with] return cmd_id diff --git a/gn_auth/jobs.py b/gn_auth/jobs.py index 6fc9bba..8f9f4f0 100644 --- a/gn_auth/jobs.py +++ b/gn_auth/jobs.py @@ -9,7 +9,7 @@ from pymonad.either import Left, Right, Either from gn_auth import json_encoders_decoders as jed -JOBS_NAMESPACE = "GN3_AUTH::JOBS" +JOBS_NAMESPACE = "GN_AUTH::JOBS" class InvalidCommand(Exception): """Raise if the command to run is invalid.""" diff --git a/gn_auth/settings.py b/gn_auth/settings.py index 394c557..a60ab7e 100644 --- a/gn_auth/settings.py +++ b/gn_auth/settings.py @@ -14,6 +14,7 @@ AUTH_MIGRATIONS = "migrations/auth" # Redis settings REDIS_URI = "redis://localhost:6379/0" +REDIS_JOB_QUEUE = "GN_AUTH::job-queue" # OAuth2 settings OAUTH2_SCOPE = ( -- cgit v1.2.3