mirror of
https://github.com/Caraxi/mare.server.git
synced 2026-01-02 23:03:38 +01:00
adjust to await foreach and adjust enqueue ident change
This commit is contained in:
parent
1c8f16fac0
commit
b58d882686
2 changed files with 6 additions and 6 deletions
|
|
@ -27,8 +27,8 @@ public class GrpcClientIdentificationService : IHostedService
|
|||
private CancellationTokenSource _streamCts = new();
|
||||
private CancellationTokenSource _faultCheckCts = new();
|
||||
|
||||
public GrpcClientIdentificationService(ILogger<GrpcClientIdentificationService> logger, IdentificationService.IdentificationServiceClient gprcIdentClient,
|
||||
IdentificationService.IdentificationServiceClient gprcIdentClientStreamOut,
|
||||
public GrpcClientIdentificationService(ILogger<GrpcClientIdentificationService> logger, IdentificationService.IdentificationServiceClient gprcIdentClient,
|
||||
IdentificationService.IdentificationServiceClient gprcIdentClientStreamOut,
|
||||
IdentificationService.IdentificationServiceClient gprcIdentClientStreamIn, MareMetrics metrics, IConfiguration configuration)
|
||||
{
|
||||
var config = configuration.GetSection("MareSynchronos");
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue