protected override async Task Process() { // _logger.LogDebug("LayerUpdate task doing background work."); //var start = DateTime.UtcNow; await _mapdata.RefreshLayers(); //var end = DateTime.UtcNow; //var duration = end - start; // _logger.LogDebug($"Layer refresh took {duration.TotalMilliseconds} ms."); await Task.Delay(_options.CheckUpdateTime); }
public async Task StartAsync(CancellationToken cancellationToken) { try { _logger.LogDebug("Preforming full layer refresh upon initialization"); var timer = new Stopwatch(); timer.Start(); await _mapData.RefreshLayers(); timer.Stop(); _logger.LogDebug($"Full layer refresh finished in {timer.ElapsedMilliseconds} ms"); } catch (Exception ex) { _logger.LogError("Refreshing Layer exits unexpectedly", ex); } _subscriptionClient.RegisterOnMessageHandlerAndReceiveMessages(UpdateMapLayer); }