mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Add config variable for curl timeout
Add the config variable for curl calls ("remote_curl_timeout"). E.g., needed for nextcloud federation.
Signed-off-by: Dominik Fuchß <develop@fuchss.org>
This commit is contained in:
parent
39b716cc78
commit
c3ba871f36
2 changed files with 11 additions and 2 deletions
|
|
@ -289,6 +289,11 @@ $CONFIG = [
|
|||
*/
|
||||
'session_lifetime' => 60 * 60 * 24,
|
||||
|
||||
/**
|
||||
* The timeout for requests to remote servers (e.g., needed for federated shares).
|
||||
*/
|
||||
'remote_curl_timeout' => 30,
|
||||
|
||||
/**
|
||||
* `true` enabled a relaxed session timeout, where the session timeout would no longer be
|
||||
* handled by Nextcloud but by either the PHP garbage collection or the expiration of
|
||||
|
|
|
|||
|
|
@ -373,7 +373,9 @@ class DAV extends Common {
|
|||
->newClient()
|
||||
->get($this->createBaseUri() . $this->encodePath($path), [
|
||||
'auth' => [$this->user, $this->password],
|
||||
'stream' => true
|
||||
'stream' => true,
|
||||
// set download timeout for users with slow connections or large files
|
||||
'timeout' => \OC::$server->getConfig()->getSystemValueInt('remote_curl_timeout', 30)
|
||||
]);
|
||||
} catch (\GuzzleHttp\Exception\ClientException $e) {
|
||||
if ($e->getResponse() instanceof ResponseInterface
|
||||
|
|
@ -530,7 +532,9 @@ class DAV extends Common {
|
|||
->newClient()
|
||||
->put($this->createBaseUri() . $this->encodePath($target), [
|
||||
'body' => $source,
|
||||
'auth' => [$this->user, $this->password]
|
||||
'auth' => [$this->user, $this->password],
|
||||
// set upload timeout for users with slow connections or large files
|
||||
'timeout' => \OC::$server->getConfig()->getSystemValueInt('remote_curl_timeout', 30)
|
||||
]);
|
||||
|
||||
$this->removeCachedFile($target);
|
||||
|
|
|
|||
Loading…
Reference in a new issue