Explorar o código

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.
Alexandre Alapetite %!s(int64=6) %!d(string=hai) anos
pai
achega
946d9f5535
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/Controllers/feedController.php

+ 1 - 1
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();
 			}