Esempio n. 1
0
        static async Task <ManagementGroup[]> GetGroups(CancellationToken cancellationToken)
        {
            _logger.Info("Downloading groups...");
            var groups = await _giasApiClient.DownloadGroupsAsync(cancellationToken);

            return(await MapAsync(groups, cancellationToken));
        }
Esempio n. 2
0
        private async Task <PointInTimeGroup[]> DownloadGroupsToCacheAsync(DateTime pointInTime, CancellationToken cancellationToken)
        {
            _logger.Info("Acquiring groups file from GIAS...");

            // Download
            var groups = await _giasApiClient.DownloadGroupsAsync(cancellationToken);

            _logger.Debug($"Downloaded {groups.Length} groups from GIAS");

            // Timestamp
            var pointInTimeGroups = groups.Select(group => group.Clone <PointInTimeGroup>()).ToArray();

            foreach (var pointInTimeGroup in pointInTimeGroups)
            {
                pointInTimeGroup.PointInTime = pointInTime;
            }

            // Store
            await _groupRepository.StoreInStagingAsync(pointInTimeGroups, cancellationToken);

            _logger.Debug($"Stored {pointInTimeGroups.Length} groups in staging");

            _logger.Info("Finished downloading groups to cache");
            return(pointInTimeGroups);
        }
Esempio n. 3
0
        static async Task <Group[]> GetGroups(CancellationToken cancellationToken)
        {
            _logger.Info("Downloading groups...");
            var groups = await _giasApiClient.DownloadGroupsAsync(cancellationToken);

            _logger.Info($"Downloaded {groups.Length} groups");
            return(groups);
        }
Esempio n. 4
0
        static async Task <PointInTimeGroup[]> GetGroups(CancellationToken cancellationToken)
        {
            _logger.Info("Downloading groups...");
            var groups = await _giasApiClient.DownloadGroupsAsync(cancellationToken);

            _logger.Info($"Downloaded {groups.Length} groups");

            var pointInTimeGroups = groups.Select(group => Clone <PointInTimeGroup>(group)).ToArray();

            foreach (var pointInTimeGroup in pointInTimeGroups)
            {
                pointInTimeGroup.PointInTime = DateTime.UtcNow.Date;
            }

            return(pointInTimeGroups);
        }