Add short timeout to HTTP calls by default; cache METAR lookups
This commit is contained in:
@@ -20,6 +20,10 @@ class Http
|
||||
*/
|
||||
public static function get($uri, array $opts)
|
||||
{
|
||||
$opts = array_merge([
|
||||
'connect_timeout' => 2, // wait two seconds by default
|
||||
], $opts);
|
||||
|
||||
$client = new Client();
|
||||
$response = $client->request('GET', $uri, $opts);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user