diff options
author | Pablo Zmdl <pablo@nextcloud.com> | 2024-09-27 13:59:09 +0200 |
---|---|---|
committer | Daniel <mail@danielkesselberg.de> | 2024-10-17 22:27:10 +0200 |
commit | 280adb3e9430138dc5ff8c990f8b5a1448ef5d88 (patch) | |
tree | 8fb31f6e9e0c75a18ef8bdfe02c6e6d8c38c9045 /apps/dav/lib | |
parent | 40fd76f69e601ab5579e8ce9b81318d3924dd463 (diff) | |
download | nextcloud-server-280adb3e9430138dc5ff8c990f8b5a1448ef5d88.tar.gz nextcloud-server-280adb3e9430138dc5ff8c990f8b5a1448ef5d88.zip |
feat: configurable request timeout for carddav sync
Big federated setups may need a longer timeout, which they now can
configure.
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
Co-authored-by: Josh <josh.t.richards@gmail.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/CardDAV/SyncService.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php index 05a08d08286..026a02a72ab 100644 --- a/apps/dav/lib/CardDAV/SyncService.php +++ b/apps/dav/lib/CardDAV/SyncService.php @@ -11,6 +11,7 @@ namespace OCA\DAV\CardDAV; use OCP\AppFramework\Db\TTransactional; use OCP\AppFramework\Http; use OCP\Http\Client\IClientService; +use OCP\IConfig; use OCP\IDBConnection; use OCP\IUser; use OCP\IUserManager; @@ -33,13 +34,15 @@ class SyncService { private Converter $converter; protected string $certPath; private IClientService $clientService; + private IConfig $config; public function __construct(CardDavBackend $backend, IUserManager $userManager, IDBConnection $dbConnection, LoggerInterface $logger, Converter $converter, - IClientService $clientService) { + IClientService $clientService, + IConfig $config) { $this->backend = $backend; $this->userManager = $userManager; $this->logger = $logger; @@ -47,6 +50,7 @@ class SyncService { $this->certPath = ''; $this->dbConnection = $dbConnection; $this->clientService = $clientService; + $this->config = $config; } /** @@ -150,7 +154,8 @@ class SyncService { $options = [ 'auth' => [$userName, $sharedSecret], 'body' => $this->buildSyncCollectionRequestBody($syncToken), - 'headers' => ['Content-Type' => 'application/xml'] + 'headers' => ['Content-Type' => 'application/xml'], + 'timeout' => $this->config->getSystemValueInt('carddav_sync_request_timeout', 30) ]; $response = $client->request( |