Skip to content

Commit

Permalink
Merge pull request #93 from Aideen-Nasirishargh-CK/master
Browse files Browse the repository at this point in the history
Allow a timeout value to be set on the cURL Call.
  • Loading branch information
jcchavezs committed Oct 5, 2018
2 parents c2334dd + 31e05fb commit 500a27c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Zipkin/Reporters/Http/CurlFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public function build(array $options = [])
}, array_keys($headers), $headers);
curl_setopt($handle, CURLOPT_HTTPHEADER, $formattedHeaders);

if (isset($options['timeout'])) {
curl_setopt($handle, CURLOPT_TIMEOUT, $options['timeout']);
}

if (curl_exec($handle) !== false) {
$statusCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
Expand Down

0 comments on commit 500a27c

Please sign in to comment.