From dd82481f59b35a8dcc586868e61753210e9eba0c Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Thu, 24 Oct 2013 16:19:17 +0200 Subject: add configuration parameter to manually set the timeout of HTTP requests --- apps/files_external/lib/config.php | 3 ++- apps/files_external/lib/swift.php | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'apps/files_external/lib') diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 65d541c4b16..1210156df0b 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -95,7 +95,8 @@ class OC_Mount_Config { 'tenant' => 'Tenantname (OpenStack Object Storage)', 'password' => '*Password (OpenStack Object Storage)', 'service_name' => 'Service Name (OpenStack Object Storage)', - 'url' => 'URL of identity endpoint (OpenStack Object Storage)' + 'url' => 'URL of identity endpoint (OpenStack Object Storage)', + 'timeout' => 'Timeout of HTTP requests in seconds (optional)', ) ); } diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index fe28e124fe3..bb650dacc7b 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -109,6 +109,11 @@ class Swift extends \OC\Files\Storage\Common { } $this->anchor = new \OpenCloud\OpenStack($params['url'], $settings); + + if (isset($params['timeout'])) { + $this->anchor->setHttpTimeout($params['timeout']); + } + $this->connection = $this->anchor->ObjectStore($params['service_name'], $params['region'], 'publicURL'); try { -- cgit v1.2.3