diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index 5ee125d..610679c 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -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, diff --git a/Rocksolid_Light/rslight/scripts/expire.php b/Rocksolid_Light/rslight/scripts/expire.php index 263bf68..5cb55eb 100755 --- a/Rocksolid_Light/rslight/scripts/expire.php +++ b/Rocksolid_Light/rslight/scripts/expire.php @@ -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);