mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 05:25:42 +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:
@ -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(
|
||||
|
Reference in New Issue
Block a user