mirror of
https://github.com/friendica/friendica
synced 2025-05-01 23:04:24 +02:00
Delivery count now counts the failed delivery attempts as well
This commit is contained in:
parent
4c4ed63dca
commit
5a1a5a54dc
8 changed files with 49 additions and 11 deletions
|
@ -59,7 +59,7 @@ class Item extends BaseObject
|
|||
'event-id', 'event-created', 'event-edited', 'event-start', 'event-finish',
|
||||
'event-summary', 'event-desc', 'event-location', 'event-type',
|
||||
'event-nofinish', 'event-adjust', 'event-ignore', 'event-id',
|
||||
'delivery_queue_count', 'delivery_queue_done'
|
||||
'delivery_queue_count', 'delivery_queue_done', 'delivery_queue_failed'
|
||||
];
|
||||
|
||||
// Field list that is used to deliver items via the protocols
|
||||
|
|
|
@ -21,6 +21,7 @@ class ItemDeliveryData
|
|||
// New delivery fields with virtual field name in item fields
|
||||
'queue_count' => 'delivery_queue_count',
|
||||
'queue_done' => 'delivery_queue_done',
|
||||
'queue_failed' => 'delivery_queue_failed',
|
||||
];
|
||||
|
||||
const ACTIVITYPUB = 1;
|
||||
|
@ -88,6 +89,20 @@ class ItemDeliveryData
|
|||
return DBA::e('UPDATE `item-delivery-data` SET `queue_done` = `queue_done` + 1' . $sql . ' WHERE `iid` = ?', $item_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Increments the queue_failed for the given item ID.
|
||||
*
|
||||
* Avoids racing condition between multiple delivery threads.
|
||||
*
|
||||
* @param integer $item_id
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function incrementQueueFailed($item_id)
|
||||
{
|
||||
return DBA::e('UPDATE `item-delivery-data` SET `queue_failed` = `queue_failed` + 1 WHERE `iid` = ?', $item_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a new item delivery data entry
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue