MCPcopy Create free account
hub / github.com/Drakkar-Software/OctoBot / get_node_status

Function get_node_status

packages/node/octobot_node/scheduler/api.py:35–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33
34
35def get_node_status() -> dict[str, str | int | None | uuid.UUID]:
36 consumer_running = (
37 octobot_node.scheduler.SCHEDULER.INSTANCE
38 and octobot_node.scheduler.SCHEDULER.INSTANCE._launched
39 )
40 is_running = octobot_node.config.settings.IS_MASTER_MODE or bool(consumer_running)
41 status = "running" if is_running else "stopped"
42
43 backend_type = "postgres" if octobot_node.config.settings.SCHEDULER_POSTGRES_URL else "sqlite"
44 workers = 1
45
46 if octobot_node.config.settings.IS_MASTER_MODE:
47 node_type = "both"
48 elif octobot_node.config.settings.CONSUMER_ONLY:
49 node_type = "consumer"
50 else:
51 # no worker should run
52 node_type = "none"
53 workers = 0
54
55 return {
56 "node_type": node_type,
57 "backend_type": backend_type,
58 "workers": workers,
59 "status": status,
60 "redis_url": None,
61 "sqlite_file": octobot_node.config.settings.SCHEDULER_SQLITE_FILE if not octobot_node.config.settings.SCHEDULER_POSTGRES_URL else None,
62 }
63
64
65async def get_automation_states(

Calls

no outgoing calls