From 1e0a95ce832bd68f2ba1631ba3d1827864dee812 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Fri, 12 Jul 2024 00:02:15 +0200 Subject: [PATCH] maintenance.php: fix and update logs --- tools/maintenance.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/maintenance.php b/tools/maintenance.php index 3db3ea98..33c0a4d4 100644 --- a/tools/maintenance.php +++ b/tools/maintenance.php @@ -5,16 +5,21 @@ require dirname(__FILE__) . '/inc/cli.php'; -echo "Clearing expired bans..."; +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!"; -modLog("Deleted expired bans in {$delta}s with tools/maintenance.php"); +echo "Deleted $deleted_count expired bans in $delta seconds!\n"; +$time_tot = $delta; +$deleted_tot = $deleted_count; -echo "Clearing old antispam..."; +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!"; -modLog("Deleted expired antispam in {$delta}s with tools/maintenance.php"); +echo "Deleted $deleted_count expired antispam in $delta seconds!\n"; +$time_tot = $delta; +$deleted_tot = $deleted_count; + +$time_tot = number_format((float)$time_tot, 4, '.', ''); +modLog("Deleted $deleted_tot expired entries in {$time_tot}s with maintenance tool");