fix: Skip always-running nodes in start_all/stop_all

Always-running node types (Ethernet switch, Cloud, NAT, etc.)
return 405 when start/stop is called. is_always_running() already
tracks these types; start_all/stop_all now skip them.
This commit is contained in:
YueGuobin 2026-06-11 01:26:43 +08:00
parent 3db275b199
commit 9d7c482288
No known key found for this signature in database

View File

@ -1532,21 +1532,23 @@ class Project:
@open_required @open_required
async def start_all(self): async def start_all(self):
""" """
Start all nodes Start all nodes (except always-running types like Ethernet switch, Cloud, NAT, etc.)
""" """
pool = Pool(concurrency=3) pool = Pool(concurrency=3)
for node in self.nodes.values(): for node in self.nodes.values():
pool.append(node.start) if not node.is_always_running():
pool.append(node.start)
await pool.join() await pool.join()
@open_required @open_required
async def stop_all(self): async def stop_all(self):
""" """
Stop all nodes Stop all nodes (except always-running types like Ethernet switch, Cloud, NAT, etc.)
""" """
pool = Pool(concurrency=3) pool = Pool(concurrency=3)
for node in self.nodes.values(): for node in self.nodes.values():
pool.append(node.stop) if not node.is_always_running():
pool.append(node.stop)
await pool.join() await pool.join()
@open_required @open_required