summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-07-01 07:08:47 +0200
committerVincent Petry <pvince81@owncloud.com>2015-07-01 07:08:47 +0200
commitf76773bd4c7816ffedf3e7b09029367ad82e3093 (patch)
tree027514d3fd46cfbfcef6b52d8f5d8a6978b94039 /lib/private
parent02331652d1b1704a992357735f52e174cea5c341 (diff)
parent2fe677d0edc40615c3a1af43872058c7539655af (diff)
downloadnextcloud-server-f76773bd4c7816ffedf3e7b09029367ad82e3093.tar.gz
nextcloud-server-f76773bd4c7816ffedf3e7b09029367ad82e3093.zip
Merge pull request #17259 from owncloud/chunk-cleanupgracefulonlock
Do not try clearing locked files in cache folder
Diffstat (limited to 'lib/private')
-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'));
}
}
}