This commit is contained in:
Untone 2024-02-29 13:04:25 +03:00
parent cfb0ba910f
commit d28024a69b
2 changed files with 5 additions and 3 deletions

View File

@ -78,8 +78,9 @@ async def get_author_by_user_id(user_id: str):
res = await redis.execute('GET', redis_key)
if isinstance(res, str):
author = json.loads(res)
if author.get('id'):
logger.debug(f'got author @{author.slug} #{author.id} cached today')
author_id = author.get('id')
if author_id:
logger.debug(f'got author @{author.slug} #{author_id} cached today')
return author
q = select(Author).filter(Author.user == user_id)

View File

@ -208,8 +208,9 @@ class ViewedStorage:
try:
await self.update_pages()
failed = 0
except Exception as _exc:
except Exception as exc:
failed += 1
logger.debug(exc)
logger.info(' - Обновление не удалось #%d, ожидание 10 секунд' % failed)
if failed > 3:
logger.info(' - Больше не пытаемся обновить')