clear the cached storage info after it was flagged unavailable

so that follow up operations against this one do not try to reauth and
cause lock outs

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2020-01-31 17:36:02 +01:00
parent 78c7e6f2c5
commit ef188de297
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
2 changed files with 7 additions and 0 deletions

View File

@ -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);
}
/**

View File

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