From e330e8a2eb6e27b51d693c81b5c885f776c019e5 Mon Sep 17 00:00:00 2001 From: Jordan Andrews Date: Tue, 4 Feb 2020 14:14:48 +1100 Subject: [PATCH] Log something when CA call fails --- .../TokenlessFeature.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Stratis.Feature.PoA.Tokenless/TokenlessFeature.cs b/src/Stratis.Feature.PoA.Tokenless/TokenlessFeature.cs index 25f70007ff0..0dbe49ecf18 100644 --- a/src/Stratis.Feature.PoA.Tokenless/TokenlessFeature.cs +++ b/src/Stratis.Feature.PoA.Tokenless/TokenlessFeature.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Logging; @@ -96,7 +97,15 @@ public override async Task InitializeAsync() // Initialize the CA public key / federaton member voting loop. this.caPubKeysLoop = this.asyncProvider.CreateAndRunAsyncLoop("PeriodicCAKeys", async (cancellation) => { - await this.SynchronizeMembersAsync(); + try + { + await this.SynchronizeMembersAsync(); + } + catch (Exception e) + { + this.logger.LogDebug(e, "Exception raised when calling CA to synchronize members."); + this.logger.LogWarning("Could not synchronize members with CA. CA is possibly down! Will retry in 1 minute."); + } }, this.nodeLifetime.ApplicationStopping, repeatEvery: TimeSpans.Minute,