diff --git a/lib/base.php b/lib/base.php index abbb67ee5be6..b9f2e4ad6618 100644 --- a/lib/base.php +++ b/lib/base.php @@ -729,7 +729,10 @@ public static function registerCacheHooks() { // NOTE: This will be replaced to use OCP $userSession = self::$server->getUserSession(); - $userSession->listen('postLogin', '\OC\Cache\File', 'loginListener'); + $userSession->listen('\OC\User', 'postLogin', function () { + $cache = new \OC\Cache\File(); + $cache->gc(); + }); } } diff --git a/lib/private/cache/file.php b/lib/private/cache/file.php index c70698eb7f87..bd3b5bc1cc1f 100644 --- a/lib/private/cache/file.php +++ b/lib/private/cache/file.php @@ -166,9 +166,4 @@ public function gc() { } } } - - public static function loginListener() { - $c = new self(); - $c->gc(); - } }