diff --git a/InvenTree/InvenTree/api.py b/InvenTree/InvenTree/api.py index c7386e8fbc..a006050694 100644 --- a/InvenTree/InvenTree/api.py +++ b/InvenTree/InvenTree/api.py @@ -19,6 +19,7 @@ from rest_framework.views import APIView from .views import AjaxView from .version import inventreeVersion, inventreeApiVersion, inventreeInstanceName +from .status import is_worker_running from plugins import plugins as inventree_plugins @@ -44,6 +45,7 @@ class InfoView(AjaxView): 'version': inventreeVersion(), 'instance': inventreeInstanceName(), 'apiVersion': inventreeApiVersion(), + 'worker_running': is_worker_running(), } return JsonResponse(data) diff --git a/InvenTree/InvenTree/context.py b/InvenTree/InvenTree/context.py index 43e8b904b9..3e9af2f751 100644 --- a/InvenTree/InvenTree/context.py +++ b/InvenTree/InvenTree/context.py @@ -31,7 +31,7 @@ def health_status(request): request._inventree_health_status = True status = { - 'django_q_running': InvenTree.status.is_q_cluster_running(), + 'django_q_running': InvenTree.status.is_worker_running(), } all_healthy = True diff --git a/InvenTree/InvenTree/status.py b/InvenTree/InvenTree/status.py index 42160927b0..88acc69a7a 100644 --- a/InvenTree/InvenTree/status.py +++ b/InvenTree/InvenTree/status.py @@ -14,9 +14,9 @@ from django_q.monitor import Stat logger = logging.getLogger("inventree") -def is_q_cluster_running(**kwargs): +def is_worker_running(**kwargs): """ - Return True if at least one cluster worker is running + Return True if the background worker process is oprational """ clusters = Stat.get_all() @@ -52,7 +52,7 @@ def check_system_health(**kwargs): result = True - if not is_q_cluster_running(**kwargs): + if not is_worker_running(**kwargs): result = False logger.warning(_("Background worker check failed")) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index e3a86b195f..8ef272ece2 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -107,4 +107,5 @@ volumes: type: none o: bind # This directory specified where InvenTree data are stored "outside" the docker containers - device: c:/abcdef \ No newline at end of file + # Change this path to a local system path where you want InvenTree data stored + device: /path/to/data