Fix: Skip add_compute for existing computes when opening projects

This commit is contained in:
YueGuobin 2026-05-06 13:24:27 +08:00
parent 0f4b0c567e
commit 4d06b2b7b6
No known key found for this signature in database

View File

@ -1147,7 +1147,9 @@ class Project:
topology = project_data["topology"]
for compute in topology.get("computes", []):
await self.controller.add_compute(**compute)
compute_id = compute.get("compute_id")
if compute_id not in self._controller._computes:
await self.controller.add_compute(**compute)
# Get all compute used in the project
# used to allocate application IDs for IOU nodes.