mirror of
https://github.com/friendica/friendica
synced 2025-04-27 15:10:11 +00:00
Decouple the processor from the receiver
This commit is contained in:
parent
3af55de978
commit
505191dec5
4 changed files with 57 additions and 4 deletions
|
@ -167,13 +167,14 @@ class Queue
|
|||
* Process the activity with the given id
|
||||
*
|
||||
* @param integer $id
|
||||
* @return void
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function process(int $id)
|
||||
public static function process(int $id): bool
|
||||
{
|
||||
$entry = DBA::selectFirst('inbox-entry', [], ['id' => $id]);
|
||||
if (empty($entry)) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
Logger::debug('Processing queue entry', ['id' => $entry['id'], 'type' => $entry['type'], 'object-type' => $entry['object-type'], 'uri' => $entry['object-id'], 'in-reply-to' => $entry['in-reply-to-id']]);
|
||||
|
@ -197,6 +198,8 @@ class Queue
|
|||
if (!Receiver::routeActivities($activity, $type, $push)) {
|
||||
self::remove($activity);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue