Merge pull request #24958 from owncloud/stable9_24869

[stable9] Use a capped memory cache for the user/group cache
This commit is contained in:
Vincent Petry 2016-06-02 10:38:30 +02:00
commit afe8ee0674
1 changed files with 6 additions and 2 deletions

View File

@ -36,6 +36,7 @@ namespace OCA\user_ldap;
use OCA\user_ldap\lib\Access;
use OCA\user_ldap\lib\BackendUtility;
use OC\Cache\CappedMemoryCache;
class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
protected $enabled = false;
@ -43,12 +44,12 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
/**
* @var string[] $cachedGroupMembers array of users with gid as key
*/
protected $cachedGroupMembers = array();
protected $cachedGroupMembers;
/**
* @var string[] $cachedGroupsByMember array of groups with uid as key
*/
protected $cachedGroupsByMember = array();
protected $cachedGroupsByMember;
public function __construct(Access $access) {
parent::__construct($access);
@ -57,6 +58,9 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
if(!empty($filter) && !empty($gassoc)) {
$this->enabled = true;
}
$this->cachedGroupMembers = new CappedMemoryCache();
$this->cachedGroupsByMember = new CappedMemoryCache();
}
/**