]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'fetch' into fetch-cache
authorMichael <heluecht@pirati.ca>
Mon, 1 Aug 2022 05:57:59 +0000 (05:57 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 1 Aug 2022 05:57:59 +0000 (05:57 +0000)
1  2 
src/Protocol/ActivityPub/Processor.php

index 4a420490c3fe0e7a7ba3073f6403372cc1dd3da2,6d36786a22f41f726a611e7e2469ea7d8d894bcf..4f31fe8c2872cdfe6cedfe9282e516c5acf79d20
@@@ -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)) {