]> source.dussan.org Git - nextcloud-server.git/commitdiff
use stat to determine has updated
authorJörn Friedrich Dreyer <jfd@butonic.de>
Tue, 16 Aug 2016 13:37:29 +0000 (15:37 +0200)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Fri, 26 Aug 2016 07:38:01 +0000 (09:38 +0200)
apps/files_external/lib/smb.php

index 2a4ae53bcf4bd6e633d558373a9bd36717b067b2..d1449ef4dfd3d20b529e3e2a10c9d5c7186ba6fb 100644 (file)
@@ -318,10 +318,10 @@ class SMB extends Common {
         */
        public function hasUpdated($path, $time) {
                $this->log('enter: '.__FUNCTION__."($path, $time)");
-               if (!$path and $this->root == '/') {
-                       // mtime doesn't work for shares, but giving the nature of the backend,
-                       // doing a full update is still just fast enough
-                       $result = true;
+               $stat = $this->stat($path);
+               if ($stat === false) {
+                       Util::writeLog('wnd', 'hasUpdated failed -> storage not available', Util::ERROR);
+                       throw $this->leave(__FUNCTION__, new StorageNotAvailableException());
                } else {
                        $actualTime = $this->filemtime($path);
                        $result = $actualTime > $time;