mirror of
https://github.com/friendica/friendica
synced 2025-05-05 15:44:10 +02:00
Remove failing posts
This commit is contained in:
parent
a943dbb420
commit
b0b67f1fde
2 changed files with 16 additions and 6 deletions
|
@ -76,19 +76,18 @@ class APDelivery
|
|||
|
||||
private static function deliver(string $inbox)
|
||||
{
|
||||
Post\Delivery::removeFailed($inbox);
|
||||
|
||||
$uri_ids = [];
|
||||
$posts = Post\Delivery::selectForInbox($inbox);
|
||||
$success = empty($posts);
|
||||
|
||||
foreach ($posts as $post) {
|
||||
if (self::deliverToInbox($post['command'], 0, $inbox, $post['uid'], [], $post['uri-id'])) {
|
||||
$success = true;
|
||||
} else {
|
||||
if (!self::deliverToInbox($post['command'], 0, $inbox, $post['uid'], [], $post['uri-id'])) {
|
||||
$uri_ids[] = $post['uri-id'];
|
||||
}
|
||||
}
|
||||
|
||||
return ['success' => $success, 'uri_ids' => $uri_ids];
|
||||
return ['success' => empty($uri_ids), 'uri_ids' => $uri_ids];
|
||||
}
|
||||
|
||||
private static function deliverToInbox(string $cmd, int $item_id, string $inbox, int $uid, array $receivers, int $uri_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue