mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-15 19:45:46 +00:00
Revert check on startup
This commit is contained in:
@ -210,6 +210,7 @@ Refer to the [return order settings](../order/return_order.md#return-order-setti
|
||||
|
||||
| Name | Description | Default | Units |
|
||||
| ---- | ----------- | ------- | ----- |
|
||||
{{ globalsetting("PLUGIN_ON_STARTUP") }}
|
||||
{{ globalsetting("PLUGIN_UPDATE_CHECK") }}
|
||||
{{ globalsetting("ENABLE_PLUGINS_URL") }}
|
||||
{{ globalsetting("ENABLE_PLUGINS_NAVIGATION") }}
|
||||
|
@ -2110,6 +2110,16 @@ class InvenTreeSetting(BaseInvenTreeSetting):
|
||||
'default': False,
|
||||
'validator': bool,
|
||||
},
|
||||
'PLUGIN_ON_STARTUP': {
|
||||
'name': _('Check plugins on startup'),
|
||||
'description': _(
|
||||
'Check that all plugins are installed on startup - enable in container environments'
|
||||
),
|
||||
'default': str(os.getenv('INVENTREE_DOCKER', 'False')).lower()
|
||||
in ['1', 'true'],
|
||||
'validator': bool,
|
||||
'requires_restart': True,
|
||||
},
|
||||
'PLUGIN_UPDATE_CHECK': {
|
||||
'name': _('Check for plugin updates'),
|
||||
'description': _('Enable periodic checks for updates to installed plugins'),
|
||||
|
@ -34,6 +34,18 @@ class PluginAppConfig(AppConfig):
|
||||
logger.info('Loading InvenTree plugins')
|
||||
|
||||
if not registry.is_loading:
|
||||
# this is the first startup
|
||||
try:
|
||||
from common.models import InvenTreeSetting
|
||||
|
||||
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
|
||||
pass
|
||||
|
||||
# Perform a full reload of the plugin registry
|
||||
registry.reload_plugins(
|
||||
full_reload=True, force_reload=True, collect=True
|
||||
|
@ -113,7 +113,7 @@ def install_plugins_file():
|
||||
logger.warning('Plugin file %s does not exist', str(pf))
|
||||
return
|
||||
|
||||
cmd = ['install', '-U', '-r', str(pf)]
|
||||
cmd = ['install', '--disable-pip-version-check', '-U', '-r', str(pf)]
|
||||
|
||||
try:
|
||||
pip_command(*cmd)
|
||||
|
Reference in New Issue
Block a user