예제 #1
0
 public async Task DeleteEntireHistory()
 {
     foreach (var component in _componentRegistryService.GetComponents())
     {
         await _historyService.DeleteHistory(_componentHistoryService.BuildComponentHistoryPath(component.Uid), HttpContext.RequestAborted).ConfigureAwait(false);
     }
 }
예제 #2
0
        private async Task TryUpdateComponentStatusValues(CancellationToken cancellationToken)
        {
            while (!cancellationToken.IsCancellationRequested)
            {
                try
                {
                    await Task.Delay(_options.ComponentStatusPullInterval, cancellationToken).ConfigureAwait(false);

                    foreach (var component in _componentRegistryService.GetComponents())
                    {
                        foreach (var status in component.GetStatus())
                        {
                            TryEnqueueComponentStatusValue(
                                component.Uid,
                                status.Key,
                                status.Value,
                                DateTime.UtcNow);
                        }
                    }
                }
                catch (OperationCanceledException)
                {
                }
                catch (Exception exception)
                {
                    _logger.Log(LogLevel.Error, exception, "Error while updating component property values.");
                }
            }
        }
예제 #3
0
        public async Task DeleteEntireHistory(CancellationToken cancellationToken)
        {
            await _lock.EnterAsync(cancellationToken).ConfigureAwait(false);

            try
            {
                foreach (var component in _componentRegistryService.GetComponents())
                {
                    TryDeleteEntireDirectory(BuildComponentPath(component.Uid));
                }
            }
            finally
            {
                _lock.Exit();
            }
        }
예제 #4
0
 public List <object> GetComponents()
 {
     return(_componentRegistryService.GetComponents().Select(c => CreateComponentModel(c)).ToList());
 }
 public List <Component> GetComponents()
 {
     return(_componentRegistryService.GetComponents());
 }