From 506139c1cdec8a3077e6d4be4df344837adba370 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 09:29:22 +1100 Subject: [PATCH] Worker thread fix (#6733) (#6735) * Do not enforce INVENTREE_LOG_LEVEL in dockerfile - Already defaults to WARNING anyway - Prevents override in config file * Enable plugin loading in worker thread (cherry picked from commit c82713328d2a312da6990721c7fa57ceba1cf8ec) Co-authored-by: Oliver --- Dockerfile | 1 - InvenTree/plugin/apps.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index cca4ac6a48..bb3f3134e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,6 @@ ENV PYTHONUNBUFFERED 1 ENV PIP_DISABLE_PIP_VERSION_CHECK 1 ENV INVOKE_RUN_SHELL="/bin/ash" -ENV INVENTREE_LOG_LEVEL="WARNING" ENV INVENTREE_DOCKER="true" # InvenTree paths diff --git a/InvenTree/plugin/apps.py b/InvenTree/plugin/apps.py index affc62587d..8c037ba114 100644 --- a/InvenTree/plugin/apps.py +++ b/InvenTree/plugin/apps.py @@ -10,7 +10,7 @@ from django.apps import AppConfig 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 logger = logging.getLogger('inventree') @@ -24,7 +24,8 @@ class PluginAppConfig(AppConfig): def ready(self): """The ready method is extended to initialize plugins.""" # skip loading if we run in a background thread - if not isInMainThread(): + + if not isInMainThread() and not isInWorkerThread(): return if not canAppAccessDatabase(