diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-05-03 09:29:22 +0200 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-05-03 09:29:22 +0200 |
commit | 5ba6fe29835f27b1fd3740f252ece47e97fb1dd4 (patch) | |
tree | 42e7c331f52c0211a5c27ce2bf65e127258b702b | |
parent | adf7e7295ed94a04bd9fcb056b81e664b45b4f07 (diff) | |
download | nextcloud-server-5ba6fe29835f27b1fd3740f252ece47e97fb1dd4.tar.gz nextcloud-server-5ba6fe29835f27b1fd3740f252ece47e97fb1dd4.zip |
Use a CappedCache in the user database backend
When running with a user database backend on large installations the
cache can grow to significant sizes. This can be especially problematic
when running big cron/repair jobs.
-rw-r--r-- | lib/private/user/database.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/user/database.php b/lib/private/user/database.php index 22a05090b96..fd273055ae1 100644 --- a/lib/private/user/database.php +++ b/lib/private/user/database.php @@ -48,11 +48,21 @@ * */ +use OC\Cache\CappedMemoryCache; + /** * Class for user management in a SQL Database (e.g. MySQL, SQLite) */ class OC_User_Database extends OC_User_Backend implements \OCP\IUserBackend { - private $cache = array(); + /** @var CappedMemoryCache */ + private $cache; + + /** + * OC_User_Database constructor. + */ + public function __construct() { + $this->cache = new CappedMemoryCache(); + } /** * Create a new user |