adjust logging and change faulty states
This commit is contained in:
@@ -141,7 +141,11 @@ public class GrpcClientIdentificationService : IHostedService
|
|||||||
{
|
{
|
||||||
while (!ct.IsCancellationRequested)
|
while (!ct.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
await CheckFaultStateAndResend().ConfigureAwait(false);
|
try
|
||||||
|
{
|
||||||
|
await CheckFaultStateAndResend().ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
catch { SetGrpcFaulty(); }
|
||||||
await Task.Delay(250).ConfigureAwait(false);
|
await Task.Delay(250).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -272,9 +276,6 @@ public class GrpcClientIdentificationService : IHostedService
|
|||||||
{
|
{
|
||||||
if (_grpcIsFaulty)
|
if (_grpcIsFaulty)
|
||||||
{
|
{
|
||||||
_grpcIsFaulty = false;
|
|
||||||
|
|
||||||
_logger.LogInformation("GRPC connection is restored, sending current server idents");
|
|
||||||
await RestartStreams().ConfigureAwait(false);
|
await RestartStreams().ConfigureAwait(false);
|
||||||
var msg = new ServerIdentMessage();
|
var msg = new ServerIdentMessage();
|
||||||
msg.Idents.AddRange(OnlineClients.Select(c => new SetIdentMessage()
|
msg.Idents.AddRange(OnlineClients.Select(c => new SetIdentMessage()
|
||||||
@@ -282,6 +283,8 @@ public class GrpcClientIdentificationService : IHostedService
|
|||||||
UidWithIdent = c.Value
|
UidWithIdent = c.Value
|
||||||
}));
|
}));
|
||||||
await _grpcIdentClient.RecreateServerIdentsAsync(msg).ConfigureAwait(false);
|
await _grpcIdentClient.RecreateServerIdentsAsync(msg).ConfigureAwait(false);
|
||||||
|
_logger.LogInformation("GRPC connection is restored");
|
||||||
|
_grpcIsFaulty = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ internal class IdentityService : IdentificationService.IdentificationServiceBase
|
|||||||
await responseStream.WriteAsync(cur).ConfigureAwait(false);
|
await responseStream.WriteAsync(cur).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation("Queue for " + server + " is empty: " + (identChanges.ContainsKey(server) ? identChanges[server].IsEmpty : true));
|
|
||||||
await Task.Delay(10).ConfigureAwait(false);
|
await Task.Delay(10).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user