Skip to content

Commit

Permalink
enhance(rlstats): update breakdown update time on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed Oct 22, 2024
1 parent e0b19b0 commit b8a3cab
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions rlstats/rlstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,14 @@ async def _maybe_update_tier_breakdown(self) -> None:
tier_breakdown = await get_tier_breakdown(self.rlapi_client)
except rlapi.HTTPException as e:
log.warning("Could not download tier breakdown.", exc_info=e)
return
except ValueError as e:
log.warning("Could not parse downloaded tier breakdown.", exc_info=e)
return

self.rlapi_client.tier_breakdown = tier_breakdown
self.breakdown_updated_at = now
await self.config.tier_breakdown.set(tier_breakdown)
await self.config.breakdown_updated_at.set(now)
else:
self.rlapi_client.tier_breakdown = tier_breakdown
await self.config.tier_breakdown.set(tier_breakdown)
finally:
self.breakdown_updated_at = now
await self.config.breakdown_updated_at.set(now)

async def _get_player_data_by_user_id(
self, user_id: int
Expand Down

0 comments on commit b8a3cab

Please sign in to comment.