mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 13:14:28 +00:00
Fix inbox processing for deleted actors
This commit is contained in:
parent
f31f4e9d22
commit
538af64955
2 changed files with 4 additions and 0 deletions
|
@ -1737,6 +1737,7 @@ async def save_to_inbox(
|
||||||
actor = await fetch_actor(db_session, ap.get_id(raw_object["actor"]))
|
actor = await fetch_actor(db_session, ap.get_id(raw_object["actor"]))
|
||||||
except ap.ObjectNotFoundError:
|
except ap.ObjectNotFoundError:
|
||||||
logger.warning("Actor not found")
|
logger.warning("Actor not found")
|
||||||
|
return
|
||||||
except httpx.HTTPStatusError:
|
except httpx.HTTPStatusError:
|
||||||
logger.exception("Failed to fetch actor")
|
logger.exception("Failed to fetch actor")
|
||||||
return
|
return
|
||||||
|
|
|
@ -25,6 +25,8 @@ async def prune_old_data(
|
||||||
await _prune_old_outgoing_activities(db_session)
|
await _prune_old_outgoing_activities(db_session)
|
||||||
await _prune_old_inbox_objects(db_session)
|
await _prune_old_inbox_objects(db_session)
|
||||||
|
|
||||||
|
# TODO: delete actor with no remaining inbox objects
|
||||||
|
|
||||||
await db_session.commit()
|
await db_session.commit()
|
||||||
# Reclaim disk space
|
# Reclaim disk space
|
||||||
await db_session.execute("VACUUM") # type: ignore
|
await db_session.execute("VACUUM") # type: ignore
|
||||||
|
@ -110,5 +112,6 @@ async def _prune_old_inbox_objects(
|
||||||
|
|
||||||
|
|
||||||
async def run_prune_old_data() -> None:
|
async def run_prune_old_data() -> None:
|
||||||
|
"""CLI entrypoint."""
|
||||||
async with async_session() as db_session:
|
async with async_session() as db_session:
|
||||||
await prune_old_data(db_session)
|
await prune_old_data(db_session)
|
||||||
|
|
Loading…
Reference in a new issue