From 946d9f5535ddc62fb667edd27e57bde419586e23 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 14 Apr 2020 00:09:13 +0200 Subject: [PATCH] Reduce DB locks (#2899) Do not lock the DB to update it when there is nothing to commit. This should reduce the risk of seeing some `database is locked` errors. --- app/Controllers/feedController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 43a6b7287..1f0d2d8ff 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -462,7 +462,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { break; } } - if (!$noCommit) { + if (!$noCommit && ($nb_new_articles > 0 || $updated_feeds > 0)) { if (!$entryDAO->inTransaction()) { $entryDAO->beginTransaction(); }