Skip to content

Commit

Permalink
fix: some garven errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Skelmis committed Mar 13, 2024
1 parent fbb70b9 commit 8dc159e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions garven/routers/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ async def guild_count(request: Request):
log.error("/guilds/count WS threw '%s'", item.response_data)
continue

if item is None:
statistic.partial_response = True
log.error(
"/guilds/count gave a null item",
)
continue

statistic.statistic += item

cluster_count = int(os.environ.get("CLUSTER_COUNT", 11))
Expand Down
9 changes: 7 additions & 2 deletions garven/routers/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ async def cluster_status(request: Request):
z: Server = request.app.zonis
d: dict[str, dict[str, str]] = await z.request_all("cluster_ws_status")
shard_data = {}
for _, item in deepcopy(d).items():
for c, item in deepcopy(d).items():
if isinstance(item, RequestFailed):
partial_response = True
log.error("/cluster/status/ws WS threw '%s'", item.response_data)
log.error("/cluster/latency/ws WS threw '%s'", item.response_data)
continue

if item is None:
partial_response = True
log.error("/cluster/latency/ws had a null value from %s", c)
continue

for shard_id, value in item.items():
Expand Down

0 comments on commit 8dc159e

Please sign in to comment.