diff --git a/lib/private/Files/Cache/Storage.php b/lib/private/Files/Cache/Storage.php index 13af41acfe..263e0bac9c 100644 --- a/lib/private/Files/Cache/Storage.php +++ b/lib/private/Files/Cache/Storage.php @@ -173,6 +173,7 @@ class Storage { $sql = 'UPDATE `*PREFIX*storages` SET `available` = ?, `last_checked` = ? WHERE `id` = ?'; $available = $isAvailable ? 1 : 0; \OC_DB::executeAudited($sql, [$available, time() + $delay, $this->storageId]); + self::getGlobalCache()->clearStorageInfo($this->storageId); } /** diff --git a/lib/private/Files/Cache/StorageGlobal.php b/lib/private/Files/Cache/StorageGlobal.php index 26a7be2463..223eeaa53a 100644 --- a/lib/private/Files/Cache/StorageGlobal.php +++ b/lib/private/Files/Cache/StorageGlobal.php @@ -85,4 +85,10 @@ class StorageGlobal { public function clearCache() { $this->cache = []; } + + public function clearStorageInfo(string $storageId) { + if(isset($this->cache[$storageId])) { + unset($this->cache[$storageId]); + } + } }