summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-03-05 11:21:58 +0100
committerGitHub <noreply@github.com>2020-03-05 11:21:58 +0100
commit672b7ad1bc6fbdca1e05a4ab128999c3dbeea77f (patch)
tree4df3c49d6aaaaab6b0a53a78164fcb4bfc5e2ddf /lib
parent48b374f68396bbfd11c858c18038995d806a48b2 (diff)
parentf9729904694eab79ded2afbb4841787622944710 (diff)
downloadnextcloud-server-672b7ad1bc6fbdca1e05a4ab128999c3dbeea77f.tar.gz
nextcloud-server-672b7ad1bc6fbdca1e05a4ab128999c3dbeea77f.zip
Merge pull request #19743 from nextcloud/cache-updater-storage-mtime-false
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
+ ]
+ );
+ }
}
}