X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FFetchMissingActivity.php;h=bc7d80f7c538b119e54aa46864a87b0911d981f7;hb=4db4d1843d19a810f3039558d312f0de030e7d6e;hp=6cb832c779b0051348b161c5d57d9680bfb61324;hpb=073695b33c5f9c5d89d91958b09259c59e12dd98;p=friendica.git diff --git a/src/Worker/FetchMissingActivity.php b/src/Worker/FetchMissingActivity.php index 6cb832c779..bc7d80f7c5 100644 --- a/src/Worker/FetchMissingActivity.php +++ b/src/Worker/FetchMissingActivity.php @@ -23,6 +23,7 @@ namespace Friendica\Worker; use Friendica\Core\Logger; use Friendica\Core\Worker; +use Friendica\DI; use Friendica\Protocol\ActivityPub; use Friendica\Protocol\ActivityPub\Queue; use Friendica\Protocol\ActivityPub\Receiver; @@ -32,6 +33,8 @@ class FetchMissingActivity /** * Fetch missing activities * @param string $url Contact URL + * + * @return void */ public static function execute(string $url, array $child = [], string $relay_actor = '', int $completion = Receiver::COMPLETION_MANUAL) { @@ -39,10 +42,14 @@ class FetchMissingActivity $result = ActivityPub\Processor::fetchMissingActivity($url, $child, $relay_actor, $completion); if ($result) { Logger::info('Successfully fetched missing activity', ['url' => $url]); - Queue::processReplyByUri($url); } elseif (!Worker::defer()) { Logger::info('Activity could not be fetched', ['url' => $url]); - // @todo performe recursive deletion of all entries + + // recursively delete all entries that belong to this worker task + $queue = DI::app()->getQueue(); + if (!empty($queue['id'])) { + Queue::deleteByWorkerId($queue['id']); + } } else { Logger::info('Fetching deferred', ['url' => $url]); }