Don't crash the app on startup if we can't preload the GeoFeed
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user