Skip to content

Commit 932d488

Browse files
Merge pull request #47948 from nextcloud/fix/issue-34720
fix(collaboration): Reduce timeouts to 3s for link reference connects
2 parents f5512ca + d165405 commit 932d488

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/public/Collaboration/Reference/LinkReferenceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private function fetchReference(Reference $reference): void {
114114

115115
$client = $this->clientService->newClient();
116116
try {
117-
$headResponse = $client->head($reference->getId(), [ 'timeout' => 10 ]);
117+
$headResponse = $client->head($reference->getId(), [ 'timeout' => 3 ]);
118118
} catch (\Exception $e) {
119119
$this->logger->debug('Failed to perform HEAD request to get target metadata', ['exception' => $e]);
120120
return;
@@ -136,7 +136,7 @@ private function fetchReference(Reference $reference): void {
136136
}
137137

138138
try {
139-
$response = $client->get($reference->getId(), [ 'timeout' => 10, 'stream' => true ]);
139+
$response = $client->get($reference->getId(), [ 'timeout' => 3, 'stream' => true ]);
140140
} catch (\Exception $e) {
141141
$this->logger->debug('Failed to fetch link for obtaining open graph data', ['exception' => $e]);
142142
return;
@@ -184,7 +184,7 @@ private function fetchReference(Reference $reference): void {
184184
$folder = $appData->newFolder('opengraph');
185185
}
186186

187-
$response = $client->get($object->images[0]->url, ['timeout' => 10]);
187+
$response = $client->get($object->images[0]->url, ['timeout' => 3]);
188188
$contentType = $response->getHeader('Content-Type');
189189
$contentLength = $response->getHeader('Content-Length');
190190

0 commit comments

Comments
 (0)