Skip to content

Commit 049de8e

Browse files
committed
Address PR feedback
1 parent 21db6af commit 049de8e

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/SignalR/common/Http.Connections/src/Internal/HttpConnectionContext.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,10 @@ public void MarkInactive()
443443
{
444444
lock (_stateLock)
445445
{
446-
LastSeenUtc = DateTime.UtcNow;
447-
448446
if (Status == HttpConnectionStatus.Active)
449447
{
450448
Status = HttpConnectionStatus.Inactive;
449+
LastSeenUtc = DateTime.UtcNow;
451450
}
452451
}
453452
}

src/SignalR/common/Http.Connections/src/Internal/HttpConnectionManager.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private async Task ExecuteTimerLoop()
125125
{
126126
try
127127
{
128-
await ScanAsync();
128+
Scan();
129129
}
130130
catch (Exception ex)
131131
{
@@ -137,7 +137,7 @@ private async Task ExecuteTimerLoop()
137137
Log.HeartBeatEnded(_logger);
138138
}
139139

140-
public Task ScanAsync()
140+
public void Scan()
141141
{
142142
// Scan the registered connections looking for ones that have timed out
143143
foreach (var c in _connections)
@@ -164,8 +164,6 @@ public Task ScanAsync()
164164
connection.TickHeartbeat();
165165
}
166166
}
167-
168-
return Task.CompletedTask;
169167
}
170168

171169
public void CloseConnections()

src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public async Task TransportEndingGracefullyWaitsOnApplicationLongPolling()
444444

445445
// The application is still running here because the poll is only killed
446446
// by the heartbeat so we pretend to do a scan and this should force the application task to complete
447-
await manager.ScanAsync();
447+
manager.Scan();
448448

449449
// The application task should complete gracefully
450450
await connection.ApplicationTask.OrTimeout();

0 commit comments

Comments
 (0)