Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added error handling #111

Merged
merged 3 commits into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions local_setup/quickstart_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,13 @@ async def get_all_agents():

if not agent_keys:
return {"agents": []}


agents_data = await asyncio.gather(*(redis_client.get(key) for key in agent_keys))
agents_data = []
for key in agent_keys:
try:
data = await redis_client.get(key)
agents_data.append(data)
except Exception as e:
logger.error(f"An error occurred with key {key}: {e}")


agents = [{ "agent_id": key, "data": json.loads(data) } for key, data in zip(agent_keys, agents_data) if data]
Expand Down