mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 22:17:22 +01:00
adjust logging and change faulty states
This commit is contained in:
parent
3272dbe040
commit
d49ee21d01
2 changed files with 7 additions and 5 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue