Commit 1c369093 authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

cache total user count

Conflicts:
	apps/user_ldap/user_ldap.php
parent ee168a12
...@@ -291,7 +291,12 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { ...@@ -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;
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment