+ /**
+ * Remove failed posts for an inbox
+ *
+ * @param string $inbox
+ */
+ public static function removeFailed(string $inbox)
+ {
+ DBA::delete('post-delivery', ["`inbox-id` = ? AND `failed` >= ?", ItemURI::getIdByURI($inbox), DI::config()->get('system', 'worker_defer_limit')]);
+ }
+
+ /**
+ * Increment "failed" counter for the given inbox and post
+ *
+ * @param integer $uri_id
+ * @param string $inbox
+ */
+ public static function incrementFailed(int $uri_id, string $inbox)
+ {
+ return DBA::update('post-delivery', ["`failed` = `failed` + 1"], ['uri-id' => $uri_id, 'inbox-id' => ItemURI::getIdByURI($inbox)]);
+ }
+