mirror of
https://github.com/friendica/friendica
synced 2025-04-26 23:10:11 +00:00
Remove failing posts
This commit is contained in:
parent
a943dbb420
commit
b0b67f1fde
2 changed files with 16 additions and 6 deletions
|
@ -24,6 +24,7 @@ namespace Friendica\Model\Post;
|
|||
use Friendica\Database\DBA;
|
||||
use BadMethodCallException;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\ItemURI;
|
||||
|
||||
class Delivery
|
||||
|
@ -57,6 +58,16 @@ class Delivery
|
|||
DBA::delete('post-delivery', ['uri-id' => $uri_id, 'inbox-id' => ItemURI::getIdByURI($inbox)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
|
@ -70,6 +81,6 @@ class Delivery
|
|||
|
||||
public static function selectForInbox(string $inbox)
|
||||
{
|
||||
return DBA::selectToArray('post-delivery', [], ["`inbox-id` = ? AND `failed` < ?", ItemURI::getIdByURI($inbox), 15], ['order' => ['created']]);
|
||||
return DBA::selectToArray('post-delivery', [], ['inbox-id' => ItemURI::getIdByURI($inbox)], ['order' => ['created']]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue