Improved workerqueue handling

This commit is contained in:
Michael 2022-07-21 08:55:45 +00:00
parent 3966bff8a1
commit 99f7270e18
2 changed files with 22 additions and 2 deletions

View file

@ -281,6 +281,11 @@ class Processor
}
if (empty($activity['directmessage']) && ($activity['id'] != $activity['reply-to-id']) && !Post::exists(['uri' => $activity['reply-to-id']])) {
if (Queue::hasWorker($activity)) {
Logger::notice('There is already a worker task to dfetch the post.', ['parent' => $activity['reply-to-id']]);
return [];
}
$recursion_depth = $activity['recursion-depth'] ?? 0;
Logger::notice('Parent not found. Try to refetch it.', ['parent' => $activity['reply-to-id'], 'recursion-depth' => $recursion_depth]);
if ($recursion_depth < 10) {