]> source.dussan.org Git - nextcloud-server.git/commitdiff
some logging added ....
authorThomas Müller <thomas.mueller@tmit.eu>
Thu, 24 Oct 2013 12:24:56 +0000 (14:24 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Thu, 24 Oct 2013 12:24:56 +0000 (14:24 +0200)
lib/private/files/cache/scanner.php

index f63abf2d4fc6a48878833103e911317fe3bfa85b..bcf88da36708551078f4038874dd6bc7592e4506 100644 (file)
@@ -62,8 +62,12 @@ class Scanner extends BasicEmitter {
         * @return array with metadata of the file
         */
        public function getData($path) {
+               if (!$this->storage->isReadable($path)) {
+                       //cant read, nothing we can do
+                       \OCP\Util::writeLog('OC\Files\Cache\Scanner', "!!! Path '$path' is not readable !!!", \OCP\Util::ERROR);
+                       return null;
+               }
                $data = array();
-               if (!$this->storage->isReadable($path)) return null; //cant read, nothing we can do
                $data['mimetype'] = $this->storage->getMimeType($path);
                $data['mtime'] = $this->storage->filemtime($path);
                if ($data['mimetype'] == 'httpd/unix-directory') {
@@ -104,7 +108,9 @@ class Scanner extends BasicEmitter {
                                $newData = $data;
                                $cacheData = $this->cache->get($file);
                                if ($cacheData) {
-                                       $this->permissionsCache->remove($cacheData['fileid']);
+                                       if (isset($cacheData['fileid'])) {
+                                               $this->permissionsCache->remove($cacheData['fileid']);
+                                       }
                                        if ($reuseExisting) {
                                                // prevent empty etag
                                                $etag = $cacheData['etag'];
@@ -137,6 +143,9 @@ class Scanner extends BasicEmitter {
                                                }
                                                // Only update metadata that has changed
                                                $newData = array_diff($data, $cacheData);
+                                               if (isset($newData['etag'])) {
+                                                       \OCP\Util::writeLog('OC\Files\Cache\Scanner', "!!! No reuse of etag for '$file' !!!", \OCP\Util::ERROR);
+                                               }
                                        }
                                }
                                if (!empty($newData)) {