Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-05-11 17:43:47 +0300
committerGitHub <noreply@github.com>2020-05-11 17:43:47 +0300
commit394ca6f7ce9332a390e3b0e1b0687d2558ab839f (patch)
treeef2f0b4975d18c2f3e18bc07816fdbe94427cdd1 /lib
parenta30b0e125c35fe16d84985fdb5fdf69c918e72cd (diff)
parent3998f94ec0c18d79fc86e5ddc4aee7b244b222c0 (diff)
Merge pull request #20774 from nextcloud/backport/19743/stable18
[stable18] dont try to update storage mtime if we can't get the mtime
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
+ ]
+ );
+ }
}
}