From be3ea642e5d3f9a5c14aed949b3452a356927166 Mon Sep 17 00:00:00 2001 From: John Tordoff <> Date: Tue, 19 Mar 2024 13:21:44 -0400 Subject: [PATCH] refactor queue names/urls --- framework/celery_tasks/routers.py | 4 ++-- osf/external/messages/celery_publishers.py | 8 ++++---- website/settings/defaults.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/framework/celery_tasks/routers.py b/framework/celery_tasks/routers.py index 1b85855ab1bb..10696c326553 100644 --- a/framework/celery_tasks/routers.py +++ b/framework/celery_tasks/routers.py @@ -14,8 +14,8 @@ def match_by_module(task_path): return CeleryConfig.task_high_queue if task_subpath in CeleryConfig.remote_computing_modules: return CeleryConfig.task_remote_computing_queue - if task_subpath in CeleryConfig.account_status_changes: - return CeleryConfig.account_status_changes + if task_subpath in CeleryConfig.task_account_status_changes_queue: + return CeleryConfig.task_account_status_changes_queue return CeleryConfig.task_default_queue diff --git a/osf/external/messages/celery_publishers.py b/osf/external/messages/celery_publishers.py index 2e33324b2fd0..d863e7924cd2 100644 --- a/osf/external/messages/celery_publishers.py +++ b/osf/external/messages/celery_publishers.py @@ -8,7 +8,7 @@ def publish_deactivated_user(user): _publish_user_status_change.s( body={ 'action': 'deactivate', - 'user_uri': user.url, + 'user_uri': user.get_semantic_iri(), }, ) ) @@ -19,7 +19,7 @@ def publish_reactivate_user(user): _publish_user_status_change.s( body={ 'action': 'reactivate', - 'user_uri': user.url, + 'user_uri': user.get_semantic_iri(), }, ) ) @@ -31,8 +31,8 @@ def publish_merged_user(user): _publish_user_status_change.s( body={ 'action': 'merge', - 'user_uri': user.url, - 'merged_user_uri': user.merged_by.url, + 'user_uri': user.get_semantic_iri(), + 'merged_user_uri': user.merged_by.get_semantic_iri(), }, ) ) diff --git a/website/settings/defaults.py b/website/settings/defaults.py index 610fc219e3bd..fc598bf794ce 100644 --- a/website/settings/defaults.py +++ b/website/settings/defaults.py @@ -411,7 +411,7 @@ class CeleryConfig: task_med_queue = 'med' task_high_queue = 'high' task_remote_computing_queue = 'remote' - account_status_changes = 'account_status_changes' + task_account_status_changes_queue = 'account_status_changes' remote_computing_modules = { 'addons.boa.tasks.submit_to_boa', @@ -489,7 +489,7 @@ class CeleryConfig: routing_key=task_med_queue, consumer_arguments={'x-priority': 1}), Queue(task_high_queue, Exchange(task_high_queue), routing_key=task_high_queue, consumer_arguments={'x-priority': 10}), - Queue(account_status_changes, Exchange(account_status_changes), routing_key=account_status_changes) + Queue(task_account_status_changes_queue, Exchange(task_account_status_changes_queue), routing_key=task_account_status_changes_queue) ) task_default_exchange_type = 'direct'