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,12 +41,11 @@ class APDelivery extends BaseObject
$data = ActivityPub\Transmitter::createCachedActivityFromItem($target_id); $data = ActivityPub\Transmitter::createCachedActivityFromItem($target_id);
if (!empty($data)) { if (!empty($data)) {
$success = HTTPSignature::transmit($data, $inbox, $uid); $success = HTTPSignature::transmit($data, $inbox, $uid);
}
if ($success && in_array($cmd, [Delivery::POST, Delivery::COMMENT])) { if ($success && in_array($cmd, [Delivery::POST, Delivery::COMMENT])) {
ItemDeliveryData::incrementQueueDone($target_id); ItemDeliveryData::incrementQueueDone($target_id);
} }
} }
}
if (!$success) { if (!$success) {
Worker::defer(); Worker::defer();