add try-except

This commit is contained in:
user 2024-10-28 17:48:23 +03:00
parent 0f13479cb6
commit 7c4b0dd00d
1 changed files with 8 additions and 5 deletions

View File

@ -47,11 +47,14 @@ async def indexer_loop(memory, platform_found: bool, seqno: int) -> [bool, int]:
if not licensed_content:
make_log("Indexer", f"Licensed content not found: {new_license.content_id}", level="error")
try:
user = new_license.user
if user.telegram_id and licensed_content:
await (Wrapped_CBotChat(memory._telegram_bot, chat_id=user.telegram_id)).send_content(
session, licensed_content
)
except BaseException as e:
make_log("IndexerSendNewLicense", f"Error: {e}" + '\n' + traceback.format_exc(), level="error")
new_license.meta = {**new_license.meta, 'notification_sent': True}
session.commit()