summaryrefslogtreecommitdiffstats
path: root/lib/private/cache
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-06-30 17:00:46 +0200
committerVincent Petry <pvince81@owncloud.com>2015-06-30 17:00:46 +0200
commitdd4de48418466084c5e21bc7704359d4a80a3c5a (patch)
treec0c00110bc66a4448d52a4b598a20e1c1ff5de9b /lib/private/cache
parent0118bf04dc792ec3025719482b23be8d215ed467 (diff)
downloadnextcloud-server-dd4de48418466084c5e21bc7704359d4a80a3c5a.tar.gz
nextcloud-server-dd4de48418466084c5e21bc7704359d4a80a3c5a.zip
Do not try clearing locked files in cache folder
Diffstat (limited to 'lib/private/cache')
-rw-r--r--lib/private/cache/file.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/private/cache/file.php b/lib/private/cache/file.php
index 32c00125764..69008c7fab5 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'));
}
}
}