]> source.dussan.org Git - nextcloud-server.git/commitdiff
dont try to update storage mtime if we can't get the mtime 20774/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:50 +0000 (16:22 +0000)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/Cache/Updater.php

index 3809d4c2aebef1b240f0e75ea970409a5b3016d8..59cff9b3a41106bb002f86a538c3cd4ddd103c42 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
+                                       ]
+                               );
+                       }
                }
        }