public async void Start() { _logger.LogInformation($"Flight Worker started!"); while (true) { _logger.LogInformation($"Load Aircrafts({DateTime.Now})"); try { var temp = new List <AircraftView>(); var aircraftIds = await _db.Aircrafts.OnlyActive().Select(i => i.Id).ToListAsync(); foreach (var id in aircraftIds) { temp.Add(await _aircraftRepository.LoadAircraftByIdAsync(id)); } GlobalObjects.Aircrafts.Clear(); GlobalObjects.Aircrafts.AddRange(temp); Thread.Sleep(TimeSpan.FromDays(1)); } catch (Exception e) { _logger.LogError(e.Message); } } }