Fix incoming activity processing

main
Thomas Sileo 2022-07-18 21:35:02 +02:00
parent f2e28e89f8
commit 66a9778995
2 changed files with 3 additions and 1 deletions

View File

@ -145,7 +145,8 @@ async def save_actor(db_session: AsyncSession, ap_actor: ap.RawObject) -> "Actor
handle=_handle(ap_actor), handle=_handle(ap_actor),
) )
db_session.add(actor) db_session.add(actor)
await db_session.commit() await db_session.flush()
await db_session.refresh(actor)
return actor return actor

View File

@ -108,6 +108,7 @@ async def process_next_incoming_activity(db_session: AsyncSession) -> bool:
) )
except Exception: except Exception:
logger.exception("Failed") logger.exception("Failed")
await db_session.rollback()
next_activity.error = traceback.format_exc() next_activity.error = traceback.format_exc()
_set_next_try(next_activity) _set_next_try(next_activity)
else: else: