mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 19:46:46 +00:00
Worker thread fix (#6733)
* Do not enforce INVENTREE_LOG_LEVEL in dockerfile - Already defaults to WARNING anyway - Prevents override in config file * Enable plugin loading in worker thread
This commit is contained in:
parent
7905c556cf
commit
c82713328d
@ -23,7 +23,6 @@ ENV PYTHONUNBUFFERED 1
|
|||||||
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
|
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
|
||||||
ENV INVOKE_RUN_SHELL="/bin/ash"
|
ENV INVOKE_RUN_SHELL="/bin/ash"
|
||||||
|
|
||||||
ENV INVENTREE_LOG_LEVEL="WARNING"
|
|
||||||
ENV INVENTREE_DOCKER="true"
|
ENV INVENTREE_DOCKER="true"
|
||||||
|
|
||||||
# InvenTree paths
|
# InvenTree paths
|
||||||
|
@ -10,7 +10,7 @@ from django.apps import AppConfig
|
|||||||
|
|
||||||
from maintenance_mode.core import set_maintenance_mode
|
from maintenance_mode.core import set_maintenance_mode
|
||||||
|
|
||||||
from InvenTree.ready import canAppAccessDatabase, isInMainThread
|
from InvenTree.ready import canAppAccessDatabase, isInMainThread, isInWorkerThread
|
||||||
from plugin import registry
|
from plugin import registry
|
||||||
|
|
||||||
logger = logging.getLogger('inventree')
|
logger = logging.getLogger('inventree')
|
||||||
@ -24,7 +24,8 @@ class PluginAppConfig(AppConfig):
|
|||||||
def ready(self):
|
def ready(self):
|
||||||
"""The ready method is extended to initialize plugins."""
|
"""The ready method is extended to initialize plugins."""
|
||||||
# skip loading if we run in a background thread
|
# skip loading if we run in a background thread
|
||||||
if not isInMainThread():
|
|
||||||
|
if not isInMainThread() and not isInWorkerThread():
|
||||||
return
|
return
|
||||||
|
|
||||||
if not canAppAccessDatabase(
|
if not canAppAccessDatabase(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user