Exemplo n.º 1
0
        /**
         * Intended to be used as a Development / BAU Function to perform a full content refresh
         */
        public async Task UpdateAllContentAsync()
        {
            var context = new PublishContext(DateTime.UtcNow, false);

            await DeleteAllContent();
            await CacheTrees(context);

            var publications   = _publicationService.GetPublicationsWithPublishedReleases();
            var methodologyIds = publications.Where(publication => publication.MethodologyId.HasValue)
                                 .Select(publication => publication.MethodologyId.Value).Distinct();

            foreach (var publication in publications)
            {
                var releases = publication.Releases.Where(release => release.IsLatestPublishedVersionOfRelease());
                await CachePublication(publication.Id, context);
                await CacheLatestRelease(publication, context);

                foreach (var release in releases)
                {
                    await CacheFastTracks(release, context);
                    await CacheRelease(release, context);
                }
            }

            foreach (var methodologyId in methodologyIds)
            {
                await CacheMethodology(methodologyId, context);
            }
        }
Exemplo n.º 2
0
        /**
         * Intended to be used as a Development / BAU Function to perform a full content refresh
         */
        public async Task UpdateAllContentAsync()
        {
            var context = new PublishContext(DateTime.UtcNow, false);

            await DeleteAllContent();

            var publications = _publicationService.GetPublicationsWithPublishedReleases();

            foreach (var publication in publications)
            {
                var releases = publication.Releases.Where(release => release.IsLatestPublishedVersionOfRelease());
                await CacheLatestRelease(publication, context);

                foreach (var release in releases)
                {
                    await CacheFastTracks(release, context);
                    await CacheRelease(release, context);
                }
            }
        }