diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-04 15:29:17 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-04 15:29:17 +0100 |
commit | b56dbd06077dd93a7df915a1827afd4781daa547 (patch) | |
tree | c4d2c5f013afe5c1bccd1f1fa32970bfc319ce16 /apps | |
parent | 8be6054e5ce8aeffd6e305317e57e2747f7909ea (diff) | |
parent | 4255dd2b396050e757f77db86063f0f1420a87d5 (diff) | |
download | nextcloud-server-b56dbd06077dd93a7df915a1827afd4781daa547.tar.gz nextcloud-server-b56dbd06077dd93a7df915a1827afd4781daa547.zip |
Merge pull request #22816 from owncloud/external-unavailable-recheck
allow availability recheck for external storages
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_external/lib/config/configadapter.php | 8 | ||||
-rw-r--r-- | apps/files_external/lib/failedstorage.php | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/apps/files_external/lib/config/configadapter.php b/apps/files_external/lib/config/configadapter.php index 51c2debd726..d85e0f45631 100644 --- a/apps/files_external/lib/config/configadapter.php +++ b/apps/files_external/lib/config/configadapter.php @@ -23,6 +23,7 @@ namespace OCA\Files_External\Config; +use OC\Files\Storage\Wrapper\Availability; use OCA\Files_external\Migration\StorageMigrator; use OCP\Files\Storage; use OC\Files\Mount\MountPoint; @@ -34,6 +35,7 @@ use OCA\Files_external\Service\UserStoragesService; use OCA\Files_External\Service\UserGlobalStoragesService; use OCA\Files_External\Lib\StorageConfig; use OCA\Files_External\Lib\FailedStorage; +use OCP\Files\StorageNotAvailableException; /** * Make the old files_external config work with the new public mount config api @@ -132,8 +134,10 @@ class ConfigAdapter implements IMountProvider { try { $availability = $impl->getAvailability(); - if (!$availability['available']) { - $impl = new FailedStorage(['exception' => null]); + if (!$availability['available'] && !Availability::shouldRecheck($availability)) { + $impl = new FailedStorage([ + 'exception' => new StorageNotAvailableException('Storage with mount id ' . $storage->getId() . ' is not available') + ]); } } catch (\Exception $e) { // propagate exception into filesystem diff --git a/apps/files_external/lib/failedstorage.php b/apps/files_external/lib/failedstorage.php index 928d09e20f8..20cf43d74b2 100644 --- a/apps/files_external/lib/failedstorage.php +++ b/apps/files_external/lib/failedstorage.php @@ -39,6 +39,9 @@ class FailedStorage extends Common { */ public function __construct($params) { $this->e = $params['exception']; + if (!$this->e) { + throw new \InvalidArgumentException('Missing "exception" argument in FailedStorage constructor'); + } } public function getId() { |