fix ssh 6

This commit is contained in:
dv 2026-04-08 00:23:09 +03:00
parent 4fadc01ba7
commit 72489c73df

View file

@ -433,4 +433,13 @@ async def discover_via_ssh(
except Exception as exc: except Exception as exc:
result.errors.append(f"Error upserting {found.ip}: {exc}") result.errors.append(f"Error upserting {found.ip}: {exc}")
# Flush after each rack so that subsequent SELECTs (for other racks
# that may share the same device IPs) see the just-added rows.
# Without this, autoflush=False means pending db.add() calls are
# invisible to SELECT queries, causing UniqueViolationError on flush.
try:
await db.flush()
except Exception as exc:
result.errors.append(f"Flush error after rack {rack_host}: {exc}")
return result return result