diff options
author | Frederick Muriuki Muriithi | 2023-12-05 16:51:47 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-12-05 17:24:44 +0300 |
commit | bc78ac2cf926f38ef88309dd1b4288b1b1230b66 (patch) | |
tree | 8cfec39c7740b65d7e02460eaf5b7643d1c1ae2c /gn_auth | |
parent | d59c3c49b2fcb60550be68f241f2526895512e94 (diff) | |
download | gn-auth-bc78ac2cf926f38ef88309dd1b4288b1b1230b66.tar.gz |
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.
Diffstat (limited to 'gn_auth')
-rw-r--r-- | gn_auth/commands.py | 2 | ||||
-rw-r--r-- | gn_auth/jobs.py | 2 | ||||
-rw-r--r-- | gn_auth/settings.py | 1 |
3 files changed, 3 insertions, 2 deletions
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 = ( |