コード例 #1
0
        public async Task Renew()
        {
            var exceptions = new ConcurrentQueue <Exception>();

            // TODO use ForeachAsync when concurrent renewals are supported: https://github.com/sjkp/letsencrypt-siteextension/issues/161
            foreach (var renewalParams in m_renewalParamsReader.Read())
            {
                Events.RenewalInProgress(renewalParams);
                try
                {
                    await m_renewalManager.Renew(renewalParams);

                    await m_notifier.NotifyAsync(renewalParams);
                }
                catch (Exception e) when(!ExceptionHelper.IsCriticalException(e))
                {
                    Trace.TraceError("Encountered exception: {0}", e);
                    exceptions.Enqueue(e);
                }
            }

            if (exceptions.Count > 0)
            {
                throw new AggregateException("Encountered exception(s) during cert renewal (and/or notification)", exceptions);
            }
        }
コード例 #2
0
        public async Task Renew()
        {
            var exceptions = new ConcurrentQueue <Exception>();

            foreach (var renewalParams in m_renewalParamsReader.Read())
            {
                Events.RenewalInProgress(renewalParams);
                try
                {
                    await m_renewalManager.Renew(renewalParams).ConfigureAwait(false);

                    await m_notifier.NotifyAsync(renewalParams).ConfigureAwait(false);
                }
                catch (Exception e) when(!ExceptionHelper.IsCriticalException(e))
                {
                    Trace.TraceError("Encountered exception: {0}", e);
                    exceptions.Enqueue(e);
                }
            }

            if (exceptions.Count > 0)
            {
                throw new AggregateException("Encountered exception(s) during cert renewal (and/or notification)", exceptions);
            }
        }
コード例 #3
0
        public void Renew()
        {
            var exceptions = new ConcurrentQueue <Exception>();

            foreach (var renewalParams in m_renewalParamsReader.Read())
            {
                Events.RenewalInProgress(renewalParams);
                try
                {
                    m_renewalManager.Renew(renewalParams);
                    m_notifier.NotifyAsync(renewalParams).Wait(); // TODO use ForeachAsync when renewal manager supports it
                }
                catch (Exception e) when(!ExceptionHelper.IsCriticalException(e))
                {
                    Console.WriteLine("ERROR: Encountered exception: " + e);
                    exceptions.Enqueue(e);
                }
            }

            if (exceptions.Count > 0)
            {
                throw new AggregateException("Encountered exception(s) during cert renewal (and/or notification)", exceptions);
            }
        }