[PLUGIN][ActivityPub][FreeNetwork] DB::findBy won't work if not commited first

This commit is contained in:
Diogo Peralta Cordeiro 2022-02-20 13:59:06 +00:00
parent 8b0e9c7890
commit 1e310aa124
No known key found for this signature in database
GPG Key ID: 18D2D35001FBFAB0

View File

@ -382,7 +382,7 @@ class ActivityPub extends Plugin
{
try {
if (FreeNetworkActorProtocol::canIAddr('activitypub', $addr = Discovery::normalize($target))) {
$ap_actor = ActivitypubActor::getByAddr($addr);
$ap_actor = DB::wrapInTransaction(fn() => ActivitypubActor::getByAddr($addr));
$actor = Actor::getById($ap_actor->getActorId());
FreeNetworkActorProtocol::protocolSucceeded('activitypub', $actor->getId(), $addr);
return Event::stop;
@ -390,7 +390,7 @@ class ActivityPub extends Plugin
return Event::next;
}
} catch (Exception $e) {
Log::error('ActivityPub Webfinger Mention check failed.', [$e]);
Log::error('ActivityPub WebFinger Mention check failed.', [$e]);
return Event::next;
}
}