mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +00:00
parent
2f739bfbfa
commit
39648e545c
@ -885,3 +885,4 @@ if DEBUG or TESTING:
|
|||||||
# Plugin test settings
|
# Plugin test settings
|
||||||
PLUGIN_TESTING = get_setting('PLUGIN_TESTING', TESTING) # are plugins beeing tested?
|
PLUGIN_TESTING = get_setting('PLUGIN_TESTING', TESTING) # are plugins beeing tested?
|
||||||
PLUGIN_TESTING_SETUP = get_setting('PLUGIN_TESTING_SETUP', False) # load plugins from setup hooks in testing?
|
PLUGIN_TESTING_SETUP = get_setting('PLUGIN_TESTING_SETUP', False) # load plugins from setup hooks in testing?
|
||||||
|
PLUGIN_RETRY = get_setting('PLUGIN_RETRY', 5 if not TESTING else 1) # how often should plugin loading be tried?
|
||||||
|
@ -65,6 +65,7 @@ class Plugins:
|
|||||||
|
|
||||||
registered_sucessfull = False
|
registered_sucessfull = False
|
||||||
blocked_plugin = None
|
blocked_plugin = None
|
||||||
|
retry_counter = settings.PLUGIN_RETRY
|
||||||
while not registered_sucessfull:
|
while not registered_sucessfull:
|
||||||
try:
|
try:
|
||||||
# we are using the db so for migrations etc we need to try this block
|
# 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._clean_installed_apps()
|
||||||
self._activate_plugins(force_reload=True)
|
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
|
# now the loading will re-start up with init
|
||||||
|
|
||||||
# remove maintenance
|
# remove maintenance
|
||||||
|
Loading…
x
Reference in New Issue
Block a user