[perf] check duplicat accept respond
This commit is contained in:
parent
f9f398a207
commit
849f8de6f9
1 changed files with 10 additions and 4 deletions
|
@ -166,9 +166,15 @@ async def process_incoming(
|
||||||
).unique().scalar_one_or_none()
|
).unique().scalar_one_or_none()
|
||||||
|
|
||||||
if "Accept" == ap_object["type"]:
|
if "Accept" == ap_object["type"]:
|
||||||
|
try:
|
||||||
inbox_object = build_object(ap_object)
|
inbox_object = build_object(ap_object)
|
||||||
db_session.add(inbox_object)
|
db_session.add(inbox_object)
|
||||||
await db_session.flush()
|
await db_session.flush()
|
||||||
|
except IntegrityError:
|
||||||
|
logger.warning("Duplicate accept respond?")
|
||||||
|
await db_session.rollback()
|
||||||
|
return True
|
||||||
|
|
||||||
await db_session.refresh(inbox_object)
|
await db_session.refresh(inbox_object)
|
||||||
|
|
||||||
following = models.Following(
|
following = models.Following(
|
||||||
|
|
Loading…
Reference in a new issue