public async Task DeleteEntireHistory() { foreach (var component in _componentRegistryService.GetComponents()) { await _historyService.DeleteHistory(_componentHistoryService.BuildComponentHistoryPath(component.Uid), HttpContext.RequestAborted).ConfigureAwait(false); } }
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."); } } }
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(); } }
public List <object> GetComponents() { return(_componentRegistryService.GetComponents().Select(c => CreateComponentModel(c)).ToList()); }
public List <Component> GetComponents() { return(_componentRegistryService.GetComponents()); }