From 4599f8bc32ab9dd7f7159798e58e16499d68bb43 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 14 Jul 2024 15:00:42 +0200 Subject: [PATCH] maintenance.php: reduce modlog logs --- tools/maintenance.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/maintenance.php b/tools/maintenance.php index 203ec13d..0fc023a7 100644 --- a/tools/maintenance.php +++ b/tools/maintenance.php @@ -5,16 +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"; -modLog("Deleted expired bans in {$delta}s with tools/maintenance.php"); +$tot += $delta; 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"; -modLog("Deleted expired antispam in {$delta}s with tools/maintenance.php"); +$tot += $delta; + +$tot = number_format((float)$tot, 4, '.', ''); +modLog("Deleted expired entries in {$tot}s with maintenance tool");