maintenance.php: log deleted entries count

This commit is contained in:
Zankaria 2024-07-14 18:40:56 +02:00
parent 4599f8bc32
commit 61c35ebe50

View file

@ -5,21 +5,21 @@
require dirname(__FILE__) . '/inc/cli.php';
$tot = 0;
echo "Clearing expired bans...\n";
$start = microtime(true);
$deleted_count = Bans::purge($config['require_ban_view'], $config['purge_bans']);
$delta = microtime(true) - $start;
echo "Deleted $deleted_count expired bans in $delta seconds!\n";
$tot += $delta;
$time_tot = $delta;
$deleted_tot = $deleted_count;
echo "Clearing old antispam...\n";
$start = microtime(true);
$deleted_count = purge_old_antispam();
$delta = microtime(true) - $start;
echo "Deleted $deleted_count expired antispam in $delta seconds!\n";
$tot += $delta;
$time_tot = $delta;
$deleted_tot = $deleted_count;
$tot = number_format((float)$tot, 4, '.', '');
modLog("Deleted expired entries in {$tot}s with maintenance tool");
modLog("Deleted $deleted_tot expired entries in {$time_tot}s with maintenance tool");