Example #1
0
        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);
        }
Example #2
0
        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);
        }