diff options
author | Simon L <szaimen@e.mail.de> | 2023-06-12 13:53:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-12 13:53:37 +0200 |
commit | 83faba5e613b4ac8d7fce091e5b545a7a30b1640 (patch) | |
tree | cffed03ba4861a5754dae3ff61bdbf6ef1d5104e /apps/files_external | |
parent | e390a3569e97dabb373b3e9729d853a88ac2f723 (diff) | |
parent | b8c61b3515ef406c4feafc851f12262e417ba157 (diff) | |
download | nextcloud-server-83faba5e613b4ac8d7fce091e5b545a7a30b1640.tar.gz nextcloud-server-83faba5e613b4ac8d7fce091e5b545a7a30b1640.zip |
Merge pull request #38591 from nextcloud/fix/caching/avoid-haskey-get
fix(caching): Avoid checking existence before fetching
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/Swift.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php index 85b3727f4db..26e6c5315cb 100644 --- a/apps/files_external/lib/Lib/Storage/Swift.php +++ b/apps/files_external/lib/Lib/Storage/Swift.php @@ -126,9 +126,10 @@ class Swift extends \OC\Files\Storage\Common { * @throws \OCP\Files\StorageNotAvailableException */ private function fetchObject(string $path) { - if ($this->objectCache->hasKey($path)) { + $cached = $this->objectCache->get($path); + if ($cached !== null) { // might be "false" if object did not exist from last check - return $this->objectCache->get($path); + return $cached; } try { $object = $this->getContainer()->getObject($path); |