Merge pull request #19743 from nextcloud/cache-updater-storage-mtime-false

dont try to update storage mtime if we can't get the mtime
This commit is contained in:
Roeland Jago Douma 2020-03-05 11:21:58 +01:00 committed by GitHub
commit 672b7ad1bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View 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
]
);
}
}
}