Skip to content

Commit

Permalink
Fix airport info query in Discord RP
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenquyhy committed Dec 14, 2024
1 parent 087754f commit dd041a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions FlightEvents.Client.Logics/DiscordRichPresentLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,15 @@ await geocodeExecutor.ExecuteAsync(async () =>
{
try
{
var dataString = await httpClient.GetStringAsync($"https://www.airport-data.com/api/ap_info.json?icao={icao}");
var dataString = await httpClient.GetStringAsync($"https://airport-data.com/api/ap_info.json?icao={icao}");
var result = JsonConvert.DeserializeObject<AirportDataResult>(dataString);
cachedAirports.TryAdd(icao, result);
country = result.country;
}
catch (Exception ex)
{
logger.LogError(ex, $"Cannot get airport information of {icao}!");
logger.LogError(ex, "Cannot get airport information of {icao}!", icao);
// TODO: improve error handling so there is some exponential backoff for this query
}
}
}
Expand Down

0 comments on commit dd041a6

Please sign in to comment.