From 8b76db2bca5577a5b6c8c8e21526d7445a7274e1 Mon Sep 17 00:00:00 2001 From: maximumG Date: Wed, 7 Jul 2021 15:25:53 +0200 Subject: [PATCH] add: RQ queues for netbox core (high, default, low, check_release) --- netbox/netbox/settings.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index d71bc6486..fe51860a0 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -569,8 +569,10 @@ else: } RQ_QUEUES = { + 'high': RQ_PARAMS, 'default': RQ_PARAMS, # Webhooks - 'check_releases': RQ_PARAMS, + 'low': RQ_PARAMS, + 'check_release': RQ_PARAMS, } @@ -635,3 +637,14 @@ for plugin_name in PLUGINS: CACHEOPS.update({ "{}.{}".format(plugin_name, key): value for key, value in plugin_config.caching_config.items() }) + + # Create RQ queues dedicated to the plugin + # we use the plugin name as a prefix for queue name's defined in the plugin config + # ex: mysuperplugin.mysuperqueue1 + if type(plugin_config.queues) is not list: + raise ImproperlyConfigured( + "Plugin {} queues must be a list.".format(plugin_name) + ) + RQ_QUEUES.update({ + f"{plugin_name}.{queue}": RQ_PARAMS for queue in plugin_config.queues + })