2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Add testing to detecte loops

Fixes #2308
This commit is contained in:
Matthias
2021-11-20 23:18:45 +01:00
parent 2f739bfbfa
commit 39648e545c
2 changed files with 9 additions and 0 deletions

View File

@ -65,6 +65,7 @@ class Plugins:
registered_sucessfull = False
blocked_plugin = None
retry_counter = settings.PLUGIN_RETRY
while not registered_sucessfull:
try:
# we are using the db so for migrations etc we need to try this block
@ -84,6 +85,13 @@ class Plugins:
self._clean_installed_apps()
self._activate_plugins(force_reload=True)
# we do not want to end in an endless loop
retry_counter -=1
if retry_counter <= 0:
if settings.PLUGIN_TESTING:
print('Max retries, breaking loading')
break
# now the loading will re-start up with init
# remove maintenance