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); } }
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); } }
public void Renew(string[] args) { var renewalParameters = m_renewalParamsReader.Read(args); Events.RenewalInProgress(renewalParameters); m_renewalManager.Renew(renewalParameters).Wait(); }
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); } }