diff --git a/app/incoming_activities.py b/app/incoming_activities.py index e803ad9..b1135cc 100644 --- a/app/incoming_activities.py +++ b/app/incoming_activities.py @@ -112,10 +112,13 @@ async def process_next_incoming_activity( if next_activity.ap_object and next_activity.sent_by_ap_actor_id: try: async with db_session.begin_nested(): - await save_to_inbox( - db_session, - next_activity.ap_object, - next_activity.sent_by_ap_actor_id, + await asyncio.wait_for( + save_to_inbox( + db_session, + next_activity.ap_object, + next_activity.sent_by_ap_actor_id, + ), + timeout=60, ) except httpx.TimeoutException as exc: url = exc._request.url if exc._request else None diff --git a/app/utils/opengraph.py b/app/utils/opengraph.py index 426c6a0..00571e7 100644 --- a/app/utils/opengraph.py +++ b/app/utils/opengraph.py @@ -1,3 +1,4 @@ +import asyncio import mimetypes import re from typing import Any @@ -36,7 +37,7 @@ def _scrap_og_meta(url: str, html: str) -> OpenGraphMeta | None: # FIXME some page have no