Skip to content

Commit

Permalink
fix(collaboration): Reduce timeouts to 3s for link reference connects
Browse files Browse the repository at this point in the history
Fixes rest of #34720 

#34720 (comment)

Signed-off-by: Josh <[email protected]>
  • Loading branch information
joshtrichards authored Sep 13, 2024
1 parent dfa994e commit d165405
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/public/Collaboration/Reference/LinkReferenceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private function fetchReference(Reference $reference): void {

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

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

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

Expand Down

0 comments on commit d165405

Please sign in to comment.