Don't crash the app on startup if we can't preload the GeoFeed
This commit is contained in:
parent
e49ec42f30
commit
8a18e71a6f
|
|
@ -21,6 +21,17 @@ namespace AS1024.GeoFeed.GeoFeedBuilder
|
|||
}
|
||||
|
||||
async Task IHostedService.StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
await StartPreLoad();
|
||||
} catch (Exception ex)
|
||||
{
|
||||
logger.LogWarning($"Failed to preload, exception settings below:\n{ex}");
|
||||
}
|
||||
}
|
||||
|
||||
private async Task StartPreLoad()
|
||||
{
|
||||
logger.LogInformation("Preloading GeoFeed data in memory...");
|
||||
List<Models.IPGeoFeed> feed = await provider.GetGeoFeedData();
|
||||
|
|
|
|||
Loading…
Reference in New Issue