From: Michael Date: Mon, 1 Aug 2022 05:57:59 +0000 (+0000) Subject: Merge branch 'fetch' into fetch-cache X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7d5b4808cd26f83ceff7db918277fc5952e0abb8;p=friendica.git Merge branch 'fetch' into fetch-cache --- 7d5b4808cd26f83ceff7db918277fc5952e0abb8 diff --cc src/Protocol/ActivityPub/Processor.php index 4a420490c3,6d36786a22..4f31fe8c28 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@@ -343,9 -333,15 +343,15 @@@ class Processo if ($fetch_by_worker) { Logger::notice('Fetching is done by worker.', ['parent' => $activity['reply-to-id'], 'recursion-depth' => $recursion_depth]); $activity['recursion-depth'] = 0; - $wid = Worker::add(PRIORITY_HIGH, 'FetchMissingActivity', $activity['reply-to-id'], $activity, '', Receiver::COMPLETION_AUTO); - Queue::setWorkerId($activity, $wid); + if (!Fetch::hasWorker($activity['reply-to-id'])) { + Fetch::add($activity['reply-to-id']); + $wid = Worker::add(PRIORITY_HIGH, 'FetchMissingActivity', $activity['reply-to-id'], $activity, '', Receiver::COMPLETION_AUTO); + Fetch::setWorkerId($activity['reply-to-id'], $wid); + Queue::setWorkerId($activity, $wid); + } else { + Logger::debug('Activity is already in the fetching process', ['url' => $activity['reply-to-id']]); + } - if (!empty($conversation)) { + if (empty($conversation)) { return []; } } elseif (!empty($result)) {