summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-05-03 09:29:22 +0200
committerRoeland Jago Douma <rullzer@owncloud.com>2016-05-03 13:10:03 +0200
commitd1f8e172944a97f5aa8e36038ba7381583e7cefa (patch)
tree2ebf60348eeca08535b991cda45652a1fe07df05 /lib
parent6080a3869eeee0010faae09104332add6e6d2e35 (diff)
downloadnextcloud-server-d1f8e172944a97f5aa8e36038ba7381583e7cefa.tar.gz
nextcloud-server-d1f8e172944a97f5aa8e36038ba7381583e7cefa.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.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/user/database.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/user/database.php b/lib/private/user/database.php
index 3cf73f939e5..abaac01a678 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