From 3c137e812a58e7f4c27245f3daf9e56fbc720cab Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 8 Feb 2019 23:20:15 -0500 Subject: [PATCH] Fix delivery data increment in APDelivery - Avoid incrementing the queue done if Transmitter::createCachedActivityFromItem fails --- src/Worker/APDelivery.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Worker/APDelivery.php b/src/Worker/APDelivery.php index 634a9446e..2048b97d0 100644 --- a/src/Worker/APDelivery.php +++ b/src/Worker/APDelivery.php @@ -41,10 +41,9 @@ class APDelivery extends BaseObject $data = ActivityPub\Transmitter::createCachedActivityFromItem($target_id); if (!empty($data)) { $success = HTTPSignature::transmit($data, $inbox, $uid); - } - - if ($success && in_array($cmd, [Delivery::POST, Delivery::COMMENT])) { - ItemDeliveryData::incrementQueueDone($target_id); + if ($success && in_array($cmd, [Delivery::POST, Delivery::COMMENT])) { + ItemDeliveryData::incrementQueueDone($target_id); + } } }