Add short timeout to HTTP calls by default; cache METAR lookups

This commit is contained in:
Nabeel Shahzad
2018-05-14 11:20:38 -05:00
parent c8a9ebd26d
commit 3e96b195a6
5 changed files with 34 additions and 8 deletions

View File

@@ -84,13 +84,12 @@ class AirportController extends Controller
{
$airport = Cache::remember(
config('cache.keys.AIRPORT_VACENTRAL_LOOKUP.key').$id,
config('cache.keys.RANKS_PILOT_LIST.time'),
config('cache.keys.AIRPORT_VACENTRAL_LOOKUP.time'),
function () use ($id) {
try {
return AirportLookup::get($id);
} catch (\VaCentral\HttpException $e) {
Log::error($e);
return [];
}
}