Merge pull request #2488 from nextcloud/update-cache-success-9

[9] only update the cache if the storage operation succeeds
This commit is contained in:
Roeland Jago Douma 2016-12-02 20:06:07 +01:00 committed by GitHub
commit 3e670cde9c
1 changed files with 3 additions and 3 deletions

View File

@ -1108,13 +1108,13 @@ class View {
throw $e; throw $e;
} }
if (in_array('delete', $hooks) and $result) { if ($result && in_array('delete', $hooks) and $result) {
$this->removeUpdate($storage, $internalPath); $this->removeUpdate($storage, $internalPath);
} }
if (in_array('write', $hooks) and $operation !== 'fopen') { if ($result && in_array('write', $hooks) and $operation !== 'fopen') {
$this->writeUpdate($storage, $internalPath); $this->writeUpdate($storage, $internalPath);
} }
if (in_array('touch', $hooks)) { if ($result && in_array('touch', $hooks)) {
$this->writeUpdate($storage, $internalPath, $extraParam); $this->writeUpdate($storage, $internalPath, $extraParam);
} }