diff options
author | Robin McCorkell <rmccorkell@karoshi.org.uk> | 2015-01-23 21:53:21 +0000 |
---|---|---|
committer | Robin McCorkell <rmccorkell@karoshi.org.uk> | 2015-07-20 16:27:26 +0100 |
commit | df19cabb44f9106484290a269ef6d4cb07b059d7 (patch) | |
tree | f3246817578ed3fc91c1bb05051582ac4386defd /apps/files_external/lib/config.php | |
parent | 89d6439445da8e1cf133bc2e1b6db9709ce4af8b (diff) | |
download | nextcloud-server-df19cabb44f9106484290a269ef6d4cb07b059d7.tar.gz nextcloud-server-df19cabb44f9106484290a269ef6d4cb07b059d7.zip |
Store storage availability in database
Storage status is saved in the database. Failed storages are rechecked every
10 minutes, while working storages are rechecked every request.
Using the files_external app will recheck all external storages when the
settings page is viewed, or whenever an external storage is saved.
Diffstat (limited to 'apps/files_external/lib/config.php')
-rw-r--r-- | apps/files_external/lib/config.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 5dc6d06ae06..e384512468b 100644 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -494,8 +494,16 @@ class OC_Mount_Config { if (class_exists($class)) { try { $storage = new $class($options); - if ($storage->test($isPersonal)) { - return self::STATUS_SUCCESS; + + try { + $result = $storage->test($isPersonal); + $storage->setAvailability($result); + if ($result) { + return self::STATUS_SUCCESS; + } + } catch (\Exception $e) { + $storage->setAvailability(false); + throw $e; } } catch (Exception $exception) { \OCP\Util::logException('files_external', $exception); |