File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 2020use OCP \Files \IMimeTypeDetector ;
2121use OCP \Files \StorageInvalidException ;
2222use OCP \Files \StorageNotAvailableException ;
23+ use OCP \Http \Client \IClient ;
2324use OCP \Http \Client \IClientService ;
2425use OCP \ICertificateManager ;
2526use OCP \IConfig ;
@@ -124,7 +125,7 @@ public function __construct($params) {
124125 $ this ->logger = Server::get (LoggerInterface::class);
125126 $ this ->eventLogger = Server::get (IEventLogger::class);
126127 // This timeout value will be used for the download and upload of files
127- $ this ->timeout = Server::get (IConfig::class)->getSystemValueInt ('davstorage.request_timeout ' , 30 );
128+ $ this ->timeout = Server::get (IConfig::class)->getSystemValueInt ('davstorage.request_timeout ' , IClient:: DEFAULT_REQUEST_TIMEOUT );
128129 $ this ->mimeTypeDetector = \OC ::$ server ->getMimeTypeDetector ();
129130 }
130131
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ private function buildRequestOptions(array $options): array {
5353
5454 $ defaults = [
5555 RequestOptions::VERIFY => $ this ->getCertBundle (),
56- RequestOptions::TIMEOUT => 30 ,
56+ RequestOptions::TIMEOUT => IClient:: DEFAULT_REQUEST_TIMEOUT ,
5757 ];
5858
5959 $ options ['nextcloud ' ]['allow_local_address ' ] = $ this ->isLocalAddressAllowed ($ options );
Original file line number Diff line number Diff line change 1414 * @since 8.1.0
1515 */
1616interface IClient {
17+
18+ /**
19+ * Default request timeout for requests
20+ *
21+ * @since 31.0.0
22+ */
23+ public const DEFAULT_REQUEST_TIMEOUT = 30 ;
24+
1725 /**
1826 * Sends a GET request
1927 * @param string $uri
You can’t perform that action at this time.
0 commit comments