mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
add: RQ queues for netbox core (high, default, low, check_release)
This commit is contained in:
@ -569,8 +569,10 @@ else:
|
|||||||
}
|
}
|
||||||
|
|
||||||
RQ_QUEUES = {
|
RQ_QUEUES = {
|
||||||
|
'high': RQ_PARAMS,
|
||||||
'default': RQ_PARAMS, # Webhooks
|
'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({
|
CACHEOPS.update({
|
||||||
"{}.{}".format(plugin_name, key): value for key, value in plugin_config.caching_config.items()
|
"{}.{}".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
|
||||||
|
})
|
||||||
|
Reference in New Issue
Block a user