@cryptotaxi247 / CoPilot / commits / 1f22ca86

Skip syncing vulnerabilities for agents with missing customer code

taylorwalton committed Dec 12, 2024 at 10:48 UTC 1f22ca866c25e76e72b5b3dc1109dbd8b58b39d4
1 file changed +3
backend/app/agents/routes/agents.py
+3
@@ -813,6 +813,9 @@ async def sync_vulnerabilities_route(
813 logger.info("Syncing agent vulnerabilities")
814 agents = await get_agents(session)
815 for agent in agents.agents:
816 + if agent.customer_code is None:
817 + logger.info(f"Skipping agent {agent.hostname} due to missing customer code")
818 + continue
819 await sync_agent_vulnerabilities(agent.hostname, agent.customer_code)
820 return {"success": True, "message": "Agent vulnerabilities synced successfully"}
821