2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-15 23:21:32 +00:00

Plugin reload mechanism (#5649)

* Plugin reload mechanism

- Wrap reload_plugins with mutex lock
- Add methods for calculating plugin registry hash

* Perform plugin reload at critical entry points to the registry

- Background worker will correctly reload registry before performing tasks
- Ensures that the background worker plugin regsistry is up  to date
This commit is contained in:
Oliver
2023-10-04 09:00:11 +11:00
committed by GitHub
parent 78905a45c7
commit 06eb948528
5 changed files with 137 additions and 52 deletions

View File

@@ -37,7 +37,7 @@ class SettingsMixin:
Add all defined settings form the plugins to a unified dict in the registry.
This dict is referenced by the PluginSettings for settings definitions.
"""
logger.info('Activating plugin settings')
logger.debug('Activating plugin settings')
registry.mixins_settings = {}
@@ -49,7 +49,7 @@ class SettingsMixin:
@classmethod
def _deactivate_mixin(cls, registry, **kwargs):
"""Deactivate all plugin settings."""
logger.info('Deactivating plugin settings')
logger.debug('Deactivating plugin settings')
# clear settings cache
registry.mixins_settings = {}