Fix transaction rollbacks during auto-update (#4622)

#fix https://github.com/FreshRSS/FreshRSS/issues/4600
We first need to commit the SQL transaction before being able to auto-update.
Avoid error such as:
> 25P02: 7 ERROR:  current transaction is aborted, commands ignored until end of transaction block
This commit is contained in:
Alexandre Alapetite
2022-09-19 11:51:44 +02:00
committed by GitHub
parent 6813e16e95
commit 412b60ca83
3 changed files with 9 additions and 0 deletions

View File

@@ -15,6 +15,9 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable
}
protected function addColumn($name) {
if ($this->pdo->inTransaction()) {
$this->pdo->commit();
}
Minz_Log::warning(__method__ . ': ' . $name);
try {
if ($name === 'kind') { //v1.20.0

View File

@@ -62,6 +62,9 @@ SQL;
}
protected function addColumn(string $name) {
if ($this->pdo->inTransaction()) {
$this->pdo->commit();
}
Minz_Log::warning(__method__ . ': ' . $name);
try {
if ($name === 'attributes') { //v1.20.0

View File

@@ -3,6 +3,9 @@
class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable {
protected function addColumn(string $name) {
if ($this->pdo->inTransaction()) {
$this->pdo->commit();
}
Minz_Log::warning(__method__ . ': ' . $name);
try {
if ($name === 'kind') { //v1.20.0