]> source.dussan.org Git - nextcloud-server.git/commitdiff
dont try to update storage mtime if we can't get the mtime 20775/head
authorRobin Appelman <robin@icewind.nl>
Mon, 2 Mar 2020 13:24:45 +0000 (14:24 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 1 May 2020 16:22:59 +0000 (16:22 +0000)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/Cache/Updater.php

index 57a3d895cd28b9453433affc8c6fecd8ed6b04ac..4476dce431c6533c833d64e2717aaebeefc2fc8e 100644 (file)
@@ -224,12 +224,15 @@ class Updater implements IUpdater {
        private function updateStorageMTimeOnly($internalPath) {
                $fileId = $this->cache->getId($internalPath);
                if ($fileId !== -1) {
-                       $this->cache->update(
-                               $fileId, [
-                                       'mtime' => null, // this magic tells it to not overwrite mtime
-                                       'storage_mtime' => $this->storage->filemtime($internalPath)
-                               ]
-                       );
+                       $mtime = $this->storage->filemtime($internalPath);
+                       if ($mtime !== false) {
+                               $this->cache->update(
+                                       $fileId, [
+                                               'mtime' => null, // this magic tells it to not overwrite mtime
+                                               'storage_mtime' => $mtime
+                                       ]
+                               );
+                       }
                }
        }