Replace references to UTC_TIMESTAMP in SQL queries with a DateTimeFormat generated parameter

This commit is contained in:
Hypolite Petovan 2021-12-02 09:19:01 -05:00
parent ecaed2a845
commit 80da47921e
14 changed files with 37 additions and 28 deletions

View file

@ -25,6 +25,7 @@ use Friendica\Core\Logger;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
class UpdateGServers
@ -47,7 +48,7 @@ class UpdateGServers
}
$total = DBA::count('gserver');
$condition = ["`next_contact` < UTC_TIMESTAMP() AND (`nurl` != ? OR `url` != ?)", '', ''];
$condition = ["`next_contact` < ? AND (`nurl` != ? OR `url` != ?)", DateTimeFormat::utcNow(), '', ''];
$outdated = DBA::count('gserver', $condition);
Logger::info('Server status', ['total' => $total, 'outdated' => $outdated, 'updating' => $limit]);