Some cleanup to handle rebuilding large groups.
This commit is contained in:
parent
034ce67950
commit
f27c5c6657
|
@ -1826,7 +1826,7 @@ function add_to_history($group, $number, $msgid, $status, $statusdate, $statusre
|
||||||
global $spooldir;
|
global $spooldir;
|
||||||
$history = $spooldir . '/history.db3';
|
$history = $spooldir . '/history.db3';
|
||||||
$history_dbh = history_db_open($history);
|
$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 = $history_dbh->prepare($history_sql);
|
||||||
$history_stmt->execute([
|
$history_stmt->execute([
|
||||||
$group,
|
$group,
|
||||||
|
|
|
@ -97,6 +97,12 @@ foreach ($grouplist as $groupline) {
|
||||||
]);
|
]);
|
||||||
$dbh = null;
|
$dbh = null;
|
||||||
if ($articles_dbh) {
|
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;
|
$articles_dbh = null;
|
||||||
}
|
}
|
||||||
unlink($lockfile);
|
unlink($lockfile);
|
||||||
|
|
Loading…
Reference in New Issue