Skip to content

Commit

Permalink
fix 504
Browse files Browse the repository at this point in the history
  • Loading branch information
dismorfo committed Apr 30, 2024
1 parent c68e94a commit 54deee3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions inc/endpoints/photo.inc
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ function dlts_viewer_dlts_photo_sequence_image_iiif($entity, $sequence, $region
'verify_peer_name' => FALSE,
],
'http' => [
'timeout' => 300, // 300 Seconds is 5 Minutes
'timeout' => 40,
],
];

$content = file_get_contents(
$image,
FALSE,
stream_context_create($arrContextOptions)
);
$content = file_get_contents($image, FALSE, stream_context_create($arrContextOptions));

if (!isset($http_response_header)) {
header('HTTP/1.1 504 Gateway Timeout', TRUE, 504);
die('HTTP/1.1 504 Gateway Timeout');
}

$original_image_source = file_create_url($sequence['cm']['uri']);

Expand All @@ -66,6 +67,9 @@ function dlts_viewer_dlts_photo_sequence_image_iiif($entity, $sequence, $region
'error' => $http_response_header[0],
'imageSource' => $original_image_source,
'request' => $image,
'entity' => [
'nid' => $entity->nid,
],
],
];
drupal_json_output($error);
Expand Down

0 comments on commit 54deee3

Please sign in to comment.