From df19cabb44f9106484290a269ef6d4cb07b059d7 Mon Sep 17 00:00:00 2001 From: Robin McCorkell Date: Fri, 23 Jan 2015 21:53:21 +0000 Subject: 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. --- apps/files_external/lib/config.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'apps') 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); -- cgit v1.2.3