Commit 2b9ec20d authored by Jakob Moser's avatar Jakob Moser
Browse files

Tiemout after 5 seconds

parent 95aa8f07
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -29,6 +29,11 @@ foreach($services as $service) {
  // normal option you'd also expect when using e.g., Python's `requests` library.
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

  // If the FS server is down on a network level, curl will wait until timeout before responding with a failure.
  // We set the timeout to 5s (maybe lower would be better), to still give a fast (albeit negative) response
  // when the FS server is down.
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
  
  // Append the handle to the array of handles (we need it later to get the response code) and add
  // it to the multi handle (which we need to make the requests in batch).
  $handles[] = $ch;