adjust to await foreach and adjust enqueue ident change
This commit is contained in:
@@ -226,9 +226,8 @@ public class GrpcClientIdentificationService : IHostedService
|
||||
{
|
||||
ServerId = _shardName,
|
||||
});
|
||||
while (await stream.ResponseStream.MoveNext(cts).ConfigureAwait(false))
|
||||
await foreach (var cur in stream.ResponseStream.ReadAllAsync(cts).ConfigureAwait(false))
|
||||
{
|
||||
var cur = stream.ResponseStream.Current;
|
||||
if (cur.IsOnline)
|
||||
{
|
||||
RemoteCachedIdents[cur.UidWithIdent.Uid.Uid] = cur.UidWithIdent;
|
||||
|
||||
@@ -148,9 +148,10 @@ internal class IdentityService : IdentificationService.IdentificationServiceBase
|
||||
{
|
||||
_logger.LogInformation("Enqueued " + identchange.UidWithIdent.Uid.Uid + ":" + identchange.IsOnline + " from " + identchange.UidWithIdent.Ident.ServerId);
|
||||
|
||||
foreach (var dict in identChanges.Where(k => k.Key != identchange.UidWithIdent.Ident.ServerId))
|
||||
foreach (var k in identChanges.Keys)
|
||||
{
|
||||
dict.Value.Enqueue(identchange);
|
||||
if (string.Equals(k, identchange.UidWithIdent.Ident.ServerId, System.StringComparison.Ordinal)) continue;
|
||||
identChanges[k].Enqueue(identchange);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user