cache total user count

Conflicts:
	apps/user_ldap/user_ldap.php
This commit is contained in:
Arthur Schiwon 2014-11-19 18:16:08 +01:00
parent ee168a121d
commit 1c369093e5

View file

@ -291,7 +291,12 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
*/ */
public function countUsers() { public function countUsers() {
$filter = $this->access->getFilterForUserCount(); $filter = $this->access->getFilterForUserCount();
$cacheKey = 'countUsers-'.$filter;
if(!is_null($entries = $this->access->connection->getFromCache($cacheKey))) {
return $entries;
}
$entries = $this->access->countUsers($filter); $entries = $this->access->countUsers($filter);
$this->access->connection->writeToCache($cacheKey, $entries);
return $entries; return $entries;
} }
} }