Ejemplo n.º 1
0
        /// <summary>
        /// Announces a new collection of package versions.
        /// </summary>
        /// <param name="versions">Collection of package versions.</param>
        /// <param name="token">Token of cancellation.</param>
        /// <inheritdoc />
        public async Task AnnounceAsync(IEnumerable <PackageVersion> versions, CancellationToken token)
        {
            EnsureArg.IsNotNull(versions, nameof(versions));

            versions = versions.Stale();

            packageVersionValidator.ConfirmAvailability(versions);

            var announcement = announcementFactory.CreateNew(new string[0], versions);

            await scheduleService.ScheduleAsync(announcement, token);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Extracts all configured fusions.
        /// </summary>
        /// <param name="token">Token of cancellation.</param>
        /// <inheritdoc />
        /// <exception cref="AggregateException">Throw when one or more fusions failed to extract.</exception>
        public void ExtractAll(CancellationToken token)
        {
            var fusionIds = configStore.Value?.Fuse?.Fusions?
                            .Select(_ => _.Id)?
                            .Stale() ?? new string[0];

            var announcement = announcementFactory
                               .CreateNew(fusionIds, new PackageVersion[0]);

            Extract(announcement, token);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Schedules all the configured fusions.
        /// </summary>
        /// <param name="token">The token of cancellation.</param>
        /// <inheritdoc />
        public async Task ScheduleAllAsync(CancellationToken token)
        {
            var fusionIds = configStore.Value?.Fuse?.Fusions?
                            .Select(_ => _.Id) ?? new string[0];

            var announcement = announcementFactory
                               .CreateNew(fusionIds, new PackageVersion[0]);

            try
            {
                await ScheduleAsync(announcement, token);
            }
            catch (Exception ex) when(
                !isFullCompleted &&
                configStore?.Value?.Fuse?.IgnoreInitialScheduleFailure == true
                )
            {
                logService.Error("Initial schedule failed.", ex);
            }
        }