Fix delivery data increment in APDelivery

- Avoid incrementing the queue done if Transmitter::createCachedActivityFromItem fails
This commit is contained in:
Hypolite Petovan 2019-02-08 23:20:15 -05:00
parent 7c58944449
commit 3c137e812a

View file

@ -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);
}
}
}