Rebuild threads in expire.php of over x number of articles deleted.

This commit is contained in:
Retro_Guy 2023-08-29 06:38:55 -07:00
parent 7f5fc74d0f
commit fafda5fe3d
1 changed files with 11 additions and 0 deletions

View File

@ -115,6 +115,17 @@ foreach ($grouplist as $groupline) {
}
unlink($lockfile);
touch($spooldir . '/' . $config_name . '-expire-timer');
if ($i > 50) {
echo "Rebuilding threads for " . $group . "...\n";
file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " " . $group . " Rebuilding threads...", FILE_APPEND);
unlink($spooldir . '/' . $group . '/-info.txt');
$ns = nntp_open();
if (! $ns) {
file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Failed to connect to " . $CONFIG['remote_server'] . ":" . $CONFIG['remote_port'], FILE_APPEND);
exit();
}
thread_load_newsserver($ns, $group, 0);
}
echo "Expired " . $i . " articles for " . $group . "\n";
file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " " . $group . " Expired " . $i . " articles", FILE_APPEND);
}