Spaces:
Running
Running
Download src/backend/base/langflow/services/task/utils.py from opendigital/agent-flow: direct link, hf CLI and curl.
- Browser
- Download file 602 Bytes
-
https://huggingface.co/spaces/opendigital/agent-flow/resolve/main/src/backend/base/langflow/services/task/utils.py
- Command line
-
hf download hf://spaces/opendigital/agent-flow/src/backend/base/langflow/services/task/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/opendigital/agent-flow/resolve/main/src/backend/base/langflow/services/task/utils.py
602 Bytes
| from typing import TYPE_CHECKING | |
| if TYPE_CHECKING: | |
| import contextlib | |
| with contextlib.suppress(ImportError): | |
| from celery import Celery | |
| def get_celery_worker_status(app: "Celery"): | |
| i = app.control.inspect() | |
| availability = app.control.ping() | |
| stats = i.stats() | |
| registered_tasks = i.registered() | |
| active_tasks = i.active() | |
| scheduled_tasks = i.scheduled() | |
| return { | |
| "availability": availability, | |
| "stats": stats, | |
| "registered_tasks": registered_tasks, | |
| "active_tasks": active_tasks, | |
| "scheduled_tasks": scheduled_tasks, | |
| } | |