aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-10-12 20:11:06 +0200
committerGravatar GitHub <noreply@github.com> 2017-10-12 20:11:06 +0200
commitf632a346269100d6a93bef318ffa66c97f16f6fa (patch)
treeaffdcac8889fcaeb04c9934a37ae6f3a5422c0ea /app/Controllers
parent6372e51cd6a6846c11366b5b5f56409198af6e24 (diff)
CLI optimize database (#1663)
CLI optimize database https://github.com/FreshRSS/FreshRSS/issues/1583 And VACUUM in SQLite https://github.com/FreshRSS/FreshRSS/issues/918 Add VACUUM for PostgreSQL (Not tested yet)
Diffstat (limited to 'app/Controllers')
-rwxr-xr-xapp/Controllers/configureController.php6
-rwxr-xr-xapp/Controllers/entryController.php4
-rw-r--r--app/Controllers/userController.php4
3 files changed, 9 insertions, 5 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php
index 155221d19..9d2ee450c 100755
--- a/app/Controllers/configureController.php
+++ b/app/Controllers/configureController.php
@@ -225,10 +225,12 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
$entryDAO = FreshRSS_Factory::createEntryDao();
$this->view->nb_total = $entryDAO->count();
- $this->view->size_user = $entryDAO->size();
+
+ $databaseDAO = FreshRSS_Factory::createDatabaseDAO();
+ $this->view->size_user = $databaseDAO->size();
if (FreshRSS_Auth::hasAccess('admin')) {
- $this->view->size_total = $entryDAO->size(true);
+ $this->view->size_total = $databaseDAO->size(true);
}
}
diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php
index c40588105..bd8b65b2b 100755
--- a/app/Controllers/entryController.php
+++ b/app/Controllers/entryController.php
@@ -147,8 +147,8 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
@set_time_limit(300);
- $entryDAO = FreshRSS_Factory::createEntryDao();
- $entryDAO->optimizeTable();
+ $databaseDAO = FreshRSS_Factory::createDatabaseDAO();
+ $databaseDAO->optimize();
$feedDAO = FreshRSS_Factory::createFeedDao();
$feedDAO->updateCachedValues();
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index a58501186..2a1d43d9e 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -120,7 +120,9 @@ class FreshRSS_user_Controller extends Minz_ActionController {
// Get information about the current user.
$entryDAO = FreshRSS_Factory::createEntryDao($this->view->current_user);
$this->view->nb_articles = $entryDAO->count();
- $this->view->size_user = $entryDAO->size();
+
+ $databaseDAO = FreshRSS_Factory::createDatabaseDAO();
+ $this->view->size_user = $databaseDAO->size();
}
public static function createUser($new_user_name, $passwordPlain, $apiPasswordPlain, $userConfig = array(), $insertDefaultFeeds = true) {