Skip to content

Commit

Permalink
Worker thread fix (#6733) (#6735)
Browse files Browse the repository at this point in the history
* 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 c827133)

Co-authored-by: Oliver <[email protected]>
  • Loading branch information
github-actions[bot] and SchrodingersGat authored Mar 17, 2024
1 parent cdb0f23 commit 506139c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions InvenTree/plugin/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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')
Expand All @@ -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(
Expand Down

0 comments on commit 506139c

Please sign in to comment.