mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
feat: Netbox plugin can defined their own RQ queues
This commit is contained in:
@ -52,6 +52,9 @@ class PluginConfig(AppConfig):
|
||||
'*': {'ops': 'all'},
|
||||
}
|
||||
|
||||
# Django-rq queues dedicated to the plugin
|
||||
queues = []
|
||||
|
||||
# Default integration paths. Plugin authors can override these to customize the paths to
|
||||
# integrated components.
|
||||
template_extensions = 'template_content.template_extensions'
|
||||
|
@ -12,6 +12,11 @@ class DummyPluginConfig(PluginConfig):
|
||||
middleware = [
|
||||
'extras.tests.dummy_plugin.middleware.DummyMiddleware'
|
||||
]
|
||||
queues = [
|
||||
'testing-low',
|
||||
'testing-medium',
|
||||
'testing-high'
|
||||
]
|
||||
|
||||
|
||||
config = DummyPluginConfig
|
||||
|
@ -86,6 +86,14 @@ class PluginTest(TestCase):
|
||||
"""
|
||||
self.assertIn('extras.tests.dummy_plugin.*', settings.CACHEOPS)
|
||||
|
||||
def test_queues(self):
|
||||
"""
|
||||
Check that plugin queues are registered with the accurate name.
|
||||
"""
|
||||
self.assertIn('extras.tests.dummy_plugin.testing-low', settings.RQ_QUEUES)
|
||||
self.assertIn('extras.tests.dummy_plugin.testing-medium', settings.RQ_QUEUES)
|
||||
self.assertIn('extras.tests.dummy_plugin.testing-high', settings.RQ_QUEUES)
|
||||
|
||||
def test_min_version(self):
|
||||
"""
|
||||
Check enforcement of minimum NetBox version.
|
||||
|
Reference in New Issue
Block a user