Skip to content

Commit 148ac26

Browse files
Hub connection: log connection error once
1 parent 29eaeea commit 148ac26

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Certify.Core/Management/CertifyManager/CertifyManager.ManagementHub.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public partial class CertifyManager
1717
{
1818
private IManagementServerClient _managementServerClient;
1919
private string _managementServerConnectionId = string.Empty;
20-
20+
private bool _isHubConnectionErrorLogged = false;
2121
public async Task<ActionStep> UpdateManagementHub(string url, string joiningKey)
2222
{
2323

@@ -109,7 +109,11 @@ private async Task StartManagementHubConnection(string hubUri)
109109
}
110110
catch (Exception ex)
111111
{
112-
_serviceLog.Error(ex, "Failed to connect to management hub {hubUri}", hubUri);
112+
if (!_isHubConnectionErrorLogged)
113+
{
114+
_serviceLog.Error(ex, "Could not connect to Certify Management Hub {hubUri}. Service may not be currently available. Will retry periodically, subsequent failures will not be logged.", hubUri);
115+
_isHubConnectionErrorLogged = true;
116+
}
113117

114118
_managementServerClient = null;
115119
}

0 commit comments

Comments
 (0)