From: Michael Date: Thu, 26 Oct 2023 05:01:54 +0000 (+0000) Subject: Improved processing of leftover queued posts X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c7739ef9c46ca55d488eb9c864268941ce371376;p=friendica.git Improved processing of leftover queued posts --- diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index a0ce61d9c1..21a2c4143e 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -752,6 +752,7 @@ class Processor { $post = self::getUriIdForFeaturedCollection($activity); if (empty($post)) { + Queue::remove($activity); return; } diff --git a/src/Protocol/ActivityPub/Queue.php b/src/Protocol/ActivityPub/Queue.php index 3a234e945a..4aae76a4b0 100644 --- a/src/Protocol/ActivityPub/Queue.php +++ b/src/Protocol/ActivityPub/Queue.php @@ -252,12 +252,7 @@ class Queue { $entries = DBA::select('inbox-entry', ['id', 'type', 'object-type', 'object-id', 'in-reply-to-id'], ["`trust` AND `wid` IS NULL"], ['order' => ['id' => true]]); while ($entry = DBA::fetch($entries)) { - // Don't process entries of items that are answer to nonexistent posts - if (!empty($entry['in-reply-to-id']) && !Post::exists(['uri' => $entry['in-reply-to-id']])) { - continue; - } - // We don't need to process entries that depend on already existing entries. - if (!empty($entry['in-reply-to-id']) && DBA::exists('inbox-entry', ["`id` != ? AND `object-id` = ?", $entry['id'], $entry['in-reply-to-id']])) { + if (!self::isProcessable($entry['id'])) { continue; } Logger::debug('Process leftover entry', $entry);