Close replaced test connection; add Orleans test logging
This commit is contained in:
parent
edd3dfe0de
commit
7d87447741
|
|
@ -201,7 +201,19 @@ public sealed class MatchGrain : IMatchGrain
|
|||
IMatchConnection connection,
|
||||
long resumeFromSeq)
|
||||
{
|
||||
_connections.Register(_matchId, seat, connection);
|
||||
var previous = _connections.Register(_matchId, seat, connection);
|
||||
if (previous is not null && !ReferenceEquals(previous, connection))
|
||||
{
|
||||
try
|
||||
{
|
||||
await previous.CloseAsync(4409, "replaced");
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
_logger.LogDebug(exception, "Match {MatchId}: closing old connection failed.", _matchId);
|
||||
}
|
||||
}
|
||||
|
||||
var attached = await AttachAsync(seat, playerId, resumeFromSeq);
|
||||
|
||||
if (!attached)
|
||||
|
|
|
|||
|
|
@ -95,6 +95,13 @@ public class OrleansMatchTests
|
|||
|
||||
public void Configure(ISiloBuilder siloBuilder)
|
||||
{
|
||||
siloBuilder.ConfigureLogging(logging =>
|
||||
{
|
||||
logging.ClearProviders();
|
||||
logging.AddConsole();
|
||||
logging.SetMinimumLevel(LogLevel.Debug);
|
||||
});
|
||||
|
||||
siloBuilder.ConfigureServices(services =>
|
||||
{
|
||||
var options = ServerTestData.SmallOptions();
|
||||
|
|
|
|||
Loading…
Reference in New Issue