Some cleanup to handle rebuilding large groups.

This commit is contained in:
Retro_Guy 2023-08-26 03:43:11 -07:00
parent 034ce67950
commit f27c5c6657
2 changed files with 7 additions and 1 deletions

View File

@ -1826,7 +1826,7 @@ function add_to_history($group, $number, $msgid, $status, $statusdate, $statusre
global $spooldir;
$history = $spooldir . '/history.db3';
$history_dbh = history_db_open($history);
$history_sql = 'INSERT OR IGNORE INTO history(newsgroup, number, msgid, status, statusdate, statusreason, statusnotes) VALUES(?,?,?,?,?,?,?)';
$history_sql = 'INSERT OR REPLACE INTO history(newsgroup, number, msgid, status, statusdate, statusreason, statusnotes) VALUES(?,?,?,?,?,?,?)';
$history_stmt = $history_dbh->prepare($history_sql);
$history_stmt->execute([
$group,

View File

@ -97,6 +97,12 @@ foreach ($grouplist as $groupline) {
]);
$dbh = null;
if ($articles_dbh) {
// Delete any extraneous articles from group-articles database
$articles_stmt = $articles_dbh->prepare('DELETE FROM articles WHERE newsgroup=:newsgroup AND date<:expireme');
$articles_stmt->execute([
':newsgroup' => $group,
':expireme' => $expireme
]);
$articles_dbh = null;
}
unlink($lockfile);