diff --git a/lib/base.php b/lib/base.php index 829c2bcb866e214ec71fcff36c9e4b7ab0b2a704..8812d5698f1393713f16ac0c1af8c8244cf87ca3 100644 --- a/lib/base.php +++ b/lib/base.php @@ -730,8 +730,14 @@ class OC { // NOTE: This will be replaced to use OCP $userSession = self::$server->getUserSession(); $userSession->listen('\OC\User', 'postLogin', function () { - $cache = new \OC\Cache\File(); - $cache->gc(); + try { + $cache = new \OC\Cache\File(); + $cache->gc(); + } catch (\Exception $e) { + // a GC exception should not prevent users from using OC, + // so log the exception + \OC::$server->getLogger()->warning('Exception when running cache gc: ' . $e->getMessage(), array('app' => 'core')); + } }); } }