[Pkg-owncloud-commits] [owncloud] 03/131: Catch cache garbage collection exception on postLogin

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 15:58:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.1.1
in repository owncloud.

commit 39e391fd1ad87ec034ecaba1ade2de95a53096d7
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Tue Jun 30 17:36:55 2015 +0200

    Catch cache garbage collection exception on postLogin
    
    Just log the exception instead of preventing access to OC.
---
 lib/base.php | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/base.php b/lib/base.php
index 829c2bc..8812d56 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'));
+				}
 			});
 		}
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list