Add logging for db3 write errors in spoolnews.php.

This commit is contained in:
Retro_Guy 2024-05-02 02:07:10 -07:00
parent 594b50dd7f
commit 0dbafa27fa
1 changed files with 7 additions and 0 deletions

View File

@ -2172,6 +2172,9 @@ function insert_article_from_array($this_article, $check_duplicates = true)
// Open articles Database
if ($CONFIG['article_database'] == '1') {
$article_dbh = article_db_open($spooldir . '/' . $group . '-articles.db3');
if(!$article_dbh) {
return "441 Cannot open " . $spooldir . '/' . $group . "-articles.db3\r\n";
}
$article_sql = 'INSERT OR IGNORE INTO articles(newsgroup, number, msgid, date, name, subject, article, search_snippet) VALUES(?,?,?,?,?,?,?,?)';
$article_stmt = $article_dbh->prepare($article_sql);
}
@ -2179,6 +2182,10 @@ function insert_article_from_array($this_article, $check_duplicates = true)
$database = $spooldir . '/articles-overview.db3';
$table = 'overview';
$overview_dbh = overview_db_open($database, $table);
if(!$overview_dbh) {
$article_dbh = null;
return "441 Cannot open " . $database . "\r\n";
}
$overview_sql = 'INSERT OR IGNORE INTO overview(newsgroup, number, msgid, date, datestring, name, subject, refs, bytes, lines, xref) VALUES(?,?,?,?,?,?,?,?,?,?,?)';
$overview_stmt = $overview_dbh->prepare($overview_sql);