leftypol/tools/maintenance.php
Zankaria d69eebb1d3 bans.php: refactor to expose the moratorium on ban deletion from the database.
Also fixes the 'purge_bans' configuration for non-cache deployments.
2024-07-14 18:22:51 +02:00

20 lines
764 B
PHP

<?php
/**
* Performs maintenance tasks. Invoke this periodically if the auto_maintenance configuration option is turned off.
*/
require dirname(__FILE__) . '/inc/cli.php';
echo "Clearing expired bans...";
$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 "Clearing old antispam...";
$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");