Compare commits

...

1 Commits

Author SHA1 Message Date
Arthur Schiwon ef188de297
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>
2020-01-31 17:36:02 +01:00
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]);
}
}
}