aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks123 <[email protected]>2020-03-04 10:06:48 +0200
committerGravatar ks123 <[email protected]>2020-03-04 10:06:48 +0200
commitae500f85bd664bd59d818866a89b3533bc9e94b1 (patch)
tree98a0d8d8ce2a9ea3d6f9563d1a3b1777c7f7f59b
parent(Games Cog): Added .games refresh|r command for refreshing genres. (diff)
(Games Cog): Added try block to genres refresh task.
-rw-r--r--bot/seasons/evergreen/game.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bot/seasons/evergreen/game.py b/bot/seasons/evergreen/game.py
index de8d0109..21c3b5d7 100644
--- a/bot/seasons/evergreen/game.py
+++ b/bot/seasons/evergreen/game.py
@@ -150,7 +150,12 @@ class Games(Cog):
@tasks.loop(hours=1.0)
async def refresh_genres_task(self) -> None:
"""Refresh genres in every hour."""
- await self._get_genres()
+ try:
+ await self._get_genres()
+ except Exception as e:
+ logger.warning(f"There was error while refreshing genres: {e}")
+ return
+ logger.info("Successfully refreshed genres.")
async def _get_genres(self) -> None:
"""Create genres variable for games command."""