Some small performance tweaks

This commit is contained in:
Michael 2021-07-22 15:35:30 +00:00
parent a1ee75eba7
commit bb222209bc
4 changed files with 26 additions and 9 deletions

View file

@ -170,7 +170,7 @@ class ExpirePosts
{
// We have to avoid deleting newly created "item-uri" entries.
// So we fetch a post that had been stored yesterday and only delete older ones.
$item = Post::selectFirst(['uri-id'], ["`uid` = ? AND `received` < UTC_TIMESTAMP() - INTERVAL ? DAY", 0, 1],
$item = Post::selectFirstThread(['uri-id'], ["`uid` = ? AND `received` < UTC_TIMESTAMP() - INTERVAL ? DAY", 0, 1],
['order' => ['received' => true]]);
if (empty($item['uri-id'])) {
Logger::warning('No item with uri-id found - we better quit here');