Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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ß <[email protected]>
  • Loading branch information
dfuchss authored and kesselb committed Jun 13, 2023
commit c3ba871f3633297046341b7760add409063f2512
5 changes: 5 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@
*/
'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
Expand Down
8 changes: 6 additions & 2 deletions lib/private/Files/Storage/DAV.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,9 @@ public function fopen($path, $mode) {
->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
Expand Down Expand Up @@ -530,7 +532,9 @@ protected function uploadFile($path, $target) {
->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);
Expand Down