[Pkg-owncloud-commits] [owncloud] 01/131: Do not try clearing locked files in cache folder

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 18e4fe7add6003e91d91b5fe11c60f360b0f47a2
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Tue Jun 30 17:00:46 2015 +0200

    Do not try clearing locked files in cache folder
---
 lib/private/cache/file.php | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/private/cache/file.php b/lib/private/cache/file.php
index 32c0012..69008c7 100644
--- a/lib/private/cache/file.php
+++ b/lib/private/cache/file.php
@@ -177,9 +177,16 @@ class File implements ICache {
 			}
 			while (($file = readdir($dh)) !== false) {
 				if ($file != '.' and $file != '..') {
-					$mtime = $storage->filemtime('/' . $file);
-					if ($mtime < $now) {
-						$storage->unlink('/' . $file);
+					try {
+						$mtime = $storage->filemtime('/' . $file);
+						if ($mtime < $now) {
+							$storage->unlink('/' . $file);
+						}
+					} catch (\OCP\Lock\LockedException $e) {
+						// ignore locked chunks
+						\OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', array('app' => 'core'));
+					} catch (\OCP\Files\LockNotAcquiredException $e) {
+						\OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', 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