summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-03-02 14:24:45 +0100
committerRobin Appelman <robin@icewind.nl>2020-03-02 15:57:25 +0100
commitf9729904694eab79ded2afbb4841787622944710 (patch)
tree6c0fe3dbf64ad72d4d93d30f8f590c516e330bad /lib
parent64a29d01a492db19289833ba9f485b7dca881cef (diff)
downloadnextcloud-server-f9729904694eab79ded2afbb4841787622944710.tar.gz
nextcloud-server-f9729904694eab79ded2afbb4841787622944710.zip
dont try to update storage mtime if we can't get the mtime
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Updater.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/private/Files/Cache/Updater.php b/lib/private/Files/Cache/Updater.php
index 3809d4c2aeb..59cff9b3a41 100644
--- a/lib/private/Files/Cache/Updater.php
+++ b/lib/private/Files/Cache/Updater.php
@@ -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
+ ]
+ );
+ }
}
}