From 289049d22358bc53edabbfb860a29da119f66db6 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 16 Nov 2023 02:49:29 -0500 Subject: [PATCH] Properly handle a "primary" run_on value --- api-daemon/pvcapid/flaskapi.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api-daemon/pvcapid/flaskapi.py b/api-daemon/pvcapid/flaskapi.py index 50b08b98..0f5f4f21 100755 --- a/api-daemon/pvcapid/flaskapi.py +++ b/api-daemon/pvcapid/flaskapi.py @@ -89,6 +89,8 @@ def route_task(name, args, kwargs, options, task=None, **kw): # If an explicit routing_key is set and it's in the kwargs of the function, use it to set the queue if options["routing_key"] != "default" and options["routing_key"] in kwargs.keys(): run_on = kwargs[options["routing_key"]] + if run_on == "primary": + run_on = get_primary_node() # Otherwise, use the primary node else: run_on = get_primary_node()