diff options
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Availability.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Availability.php b/lib/private/Files/Storage/Wrapper/Availability.php index b6d1ba2178b..1b532e3ba04 100644 --- a/lib/private/Files/Storage/Wrapper/Availability.php +++ b/lib/private/Files/Storage/Wrapper/Availability.php @@ -379,11 +379,15 @@ class Availability extends Wrapper { /** {@inheritdoc} */ public function hasUpdated($path, $time) { - $this->checkAvailability(); + if (!$this->isAvailable()) { + return false; + } try { return parent::hasUpdated($path, $time); } catch (StorageNotAvailableException $e) { - $this->setUnavailable($e); + // set unavailable but don't rethrow + $this->setUnavailable(null); + return false; } } @@ -449,7 +453,7 @@ class Availability extends Wrapper { /** * @throws StorageNotAvailableException */ - protected function setUnavailable(StorageNotAvailableException $e) { + protected function setUnavailable(?StorageNotAvailableException $e) { $delay = self::RECHECK_TTL_SEC; if ($e instanceof StorageAuthException) { $delay = max( @@ -459,7 +463,9 @@ class Availability extends Wrapper { ); } $this->getStorageCache()->setAvailability(false, $delay); - throw $e; + if ($e !== null) { + throw $e; + } } |