Exemple #1
0
        public async Task DeletePreviousVersionsContent(params Guid[] releaseIds)
        {
            var releases = await _releaseService.GetAmendedReleases(releaseIds);

            foreach (var release in releases)
            {
                var previousRelease = release.PreviousVersion;

                if (previousRelease == null)
                {
                    break;
                }

                await _fastTrackService.DeleteAllFastTracksByRelease(previousRelease.Id);

                // Delete any lazily-cached results that are owned by the previous Release
                await DeleteLazilyCachedReleaseResults(release.Publication.Slug, previousRelease.Slug);

                // Delete content which hasn't been overwritten because the Slug has changed
                if (release.Slug != previousRelease.Slug)
                {
                    await _publicBlobStorageService.DeleteBlob(
                        PublicContent,
                        PublicContentReleasePath(release.Publication.Slug, previousRelease.Slug)
                        );
                }
            }
        }
Exemple #2
0
        public async Task DeletePreviousVersionsContent(params Guid[] releaseIds)
        {
            var releases = await _releaseService.GetAmendedReleases(releaseIds);

            foreach (var release in releases)
            {
                if (release.PreviousVersion == null)
                {
                    break;
                }

                await _fastTrackService.DeleteAllFastTracksByRelease(release.PreviousVersion.Id);

                // Delete content which hasn't been overwritten because the Slug has changed
                if (release.Slug != release.PreviousVersion.Slug)
                {
                    await _fileStorageService.DeletePublicBlob(
                        PublicContentReleasePath(release.Publication.Slug, release.PreviousVersion.Slug)
                        );
                }
            }
        }