add more logging
This commit is contained in:
@@ -191,6 +191,7 @@ public class GrpcClientIdentificationService : IHostedService
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
using var stream = grpcIdentClientStreamOut.SendStreamIdentStatusChange(cancellationToken: cts);
|
using var stream = grpcIdentClientStreamOut.SendStreamIdentStatusChange(cancellationToken: cts);
|
||||||
|
_logger.LogInformation("Starting Send Online Client Data stream");
|
||||||
await stream.RequestStream.WriteAsync(new IdentChangeMessage()
|
await stream.RequestStream.WriteAsync(new IdentChangeMessage()
|
||||||
{
|
{
|
||||||
Server = new ServerMessage()
|
Server = new ServerMessage()
|
||||||
@@ -226,6 +227,7 @@ public class GrpcClientIdentificationService : IHostedService
|
|||||||
{
|
{
|
||||||
ServerId = _shardName,
|
ServerId = _shardName,
|
||||||
});
|
});
|
||||||
|
_logger.LogInformation("Starting Receive Online Client Data stream");
|
||||||
await foreach (var cur in stream.ResponseStream.ReadAllAsync(cts).ConfigureAwait(false))
|
await foreach (var cur in stream.ResponseStream.ReadAllAsync(cts).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
if (cur.IsOnline)
|
if (cur.IsOnline)
|
||||||
|
|||||||
@@ -105,13 +105,20 @@ internal class IdentityService : IdentificationService.IdentificationServiceBase
|
|||||||
{
|
{
|
||||||
while (!context.CancellationToken.IsCancellationRequested)
|
while (!context.CancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
while (identChanges.ContainsKey(server) && identChanges[server].TryDequeue(out var cur))
|
if (identChanges.ContainsKey(server))
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Sending " + cur.UidWithIdent.Uid.Uid + " to " + server);
|
if (identChanges[server].TryDequeue(out var cur))
|
||||||
await responseStream.WriteAsync(cur).ConfigureAwait(false);
|
{
|
||||||
|
_logger.LogInformation("Sending " + cur.UidWithIdent.Uid.Uid + " to " + server);
|
||||||
|
await responseStream.WriteAsync(cur).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Nothing to send to " + server);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await Task.Delay(10).ConfigureAwait(false);
|
await Task.Delay(250).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|||||||
Reference in New Issue
Block a user