Exemplo n.º 1
0
        /// <inheritdoc />
        public Task Execute(CancellationToken cancellationToken, IProgress <double> progress)
        {
            var retentionDays = _serverConfigurationManager.Configuration.ActivityLogRetentionDays;

            if (!retentionDays.HasValue || retentionDays <= 0)
            {
                throw new Exception($"Activity Log Retention days must be at least 0. Currently: {retentionDays}");
            }

            var startDate = DateTime.UtcNow.AddDays(retentionDays.Value * -1);

            return(_activityManager.CleanAsync(startDate));
        }