fix user rating refresh if a user is unavailable
If a user's ratings cannot be accessed, e.g. due to network errors, it should skip to the next user. Ideally we could mark a user as inactive after X failed retries.
This commit is contained in:
parent
52c08f0fd8
commit
dd3d5f3670
1 changed files with 9 additions and 5 deletions
|
|
@ -44,6 +44,7 @@ async def refresh_user_ratings_from_imdb(stop_on_dupe=True):
|
|||
|
||||
log.info("⚡️ Loading data for %s ...", user.name)
|
||||
|
||||
try:
|
||||
async for rating, is_updated in load_ratings(user.imdb_id):
|
||||
assert rating.user.id == user.id
|
||||
|
||||
|
|
@ -52,6 +53,9 @@ async def refresh_user_ratings_from_imdb(stop_on_dupe=True):
|
|||
|
||||
yield rating
|
||||
|
||||
except BaseException as err:
|
||||
log.error("❌ Could not load rating for %s!", user.name, exc_info=err)
|
||||
|
||||
|
||||
def user_ratings_url(user_id):
|
||||
return f"https://www.imdb.com/user/{user_id}/ratings"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue