From: Michael Date: Mon, 2 Sep 2019 03:37:45 +0000 (+0000) Subject: Increment the "failed" value on failed relay delivery X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=db16f1a106998647a085407f6da1f20d011bc7c0;p=friendica.git Increment the "failed" value on failed relay delivery --- diff --git a/src/Worker/Delivery.php b/src/Worker/Delivery.php index 9973154488..3079adecc2 100644 --- a/src/Worker/Delivery.php +++ b/src/Worker/Delivery.php @@ -318,7 +318,11 @@ class Delivery extends BaseObject Logger::log('Relay delivery to ' . $contact["url"] . ' with guid ' . $target_item["guid"] . ' returns ' . $deliver_status); if (in_array($cmd, [Delivery::POST, Delivery::POKE])) { - Model\ItemDeliveryData::incrementQueueDone($target_item['id'], $protocol); + if (($deliver_status >= 200) && ($deliver_status <= 299)) { + Model\ItemDeliveryData::incrementQueueDone($target_item['id'], $protocol); + } else { + Model\ItemDeliveryData::incrementQueueFailed($target_item['id']); + } } return; } @@ -448,10 +452,10 @@ class Delivery extends BaseObject Logger::info('Delivery failed: defer message', ['id' => defaults($target_item, 'guid', $target_item['id'])]); // defer message for redelivery if (!Worker::defer() && in_array($cmd, [Delivery::POST, Delivery::POKE])) { - Model\ItemDeliveryData::incrementQueueFailed($target_item['id'], Model\ItemDeliveryData::DIASPORA); + Model\ItemDeliveryData::incrementQueueFailed($target_item['id']); } } elseif (in_array($cmd, [Delivery::POST, Delivery::POKE])) { - Model\ItemDeliveryData::incrementQueueDone($target_item['id'], Model\ItemDeliveryData::DIASPORA); + Model\ItemDeliveryData::incrementQueueFailed($target_item['id']); } } }