protected override async Task <IEnumerable <QueueDataV2> > FetchResources() { var queueNames = await _queueSource.GetResourceNamesAsync(); var uniqResourcesNames = queueNames .Select(i => TrimEnd(i, ErrorQueueSuffix, StringComparison.OrdinalIgnoreCase)) .Distinct(); var result = new List <QueueDataV2>(); foreach (var resourcesName in uniqResourcesNames) { var workingQueueName = resourcesName; var errorQueueName = $"{resourcesName}{ErrorQueueSuffix}"; var hasWorkingQueue = queueNames.Any(i => string.Equals(workingQueueName, i)); var hasErrorQueue = queueNames.Any(i => string.Equals(errorQueueName, i)); var resource = new QueueDataV2(resourcesName); if (hasWorkingQueue) { resource.SetWorkingQueue(workingQueueName); resource.SetErrorQueue(errorQueueName); } if (!hasWorkingQueue && hasErrorQueue) { resource.SetErrorQueue(errorQueueName); } result.Add(resource); } return(result); }
private Task <IList <string> > ReadActiveQueueNames() { return(_queueSource.GetResourceNamesAsync()); }