Setting caching (#3178)

* Revert "Remove stat context variables"

This reverts commit 0989c308d0.

* Add a caching framework for inventree settings

- Actions that use "settings" require a DB hit every time
- For example the part.full_name() method looks at the PART_NAME_FORMAT setting
- This means 1 DB hit for every part which is serialized!!

* Fixes for DebugToolbar integration

- Requires different INTERNAL_IPS when running behind docker
- Some issues with TEMPLATES framework

* Revert "Revert "Remove stat context variables""

This reverts commit 52e6359265.

* Add unit tests for settings caching

* Update existing unit tests to handle cache framework

* Fix for unit test

* Re-enable cache for default part values

* Clear cache for further unit tests
This commit is contained in:
Oliver authored and GitHub committed 2022-06-12 10:56:16 +10:00
1 parent 90aa7b8444
commit 6eddcd3c23
9 files changed
+164 -31

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ class PluginAppConfig(AppConfig):
# this is the first startup
try:
from common.models import InvenTreeSetting
if InvenTreeSetting.get_setting('PLUGIN_ON_STARTUP', create=False):
if InvenTreeSetting.get_setting('PLUGIN_ON_STARTUP', create=False, cache=False):
# make sure all plugins are installed
registry.install_plugin_file()
except Exception: # pragma: no cover