New table to control the fetching process

This commit is contained in:
Michael 2022-08-01 04:48:49 +00:00
parent 3945de5e3b
commit 6c7dfd6958
3 changed files with 107 additions and 3 deletions

View file

@ -333,8 +333,14 @@ class Processor
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)) {
return [];
}