Skip to content

Commit 4f82af4

Browse files
committed
Fix post-notification receive loop to check the condition in the right order
1 parent a5c8279 commit 4f82af4

File tree

1 file changed

+2
-2
lines changed
  • src/IntelliTect.AspNetCore.SignalR.SqlServer/Internal/SqlServer

1 file changed

+2
-2
lines changed

src/IntelliTect.AspNetCore.SignalR.SqlServer/Internal/SqlServer/SqlReceiver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ private async Task NotificationLoop(CancellationToken cancellationToken)
134134
// Read rows immediately, since on the next loop we know for certain there will be rows.
135135
// There's no point doing a full loop that includes setting up a SqlDependency that
136136
// will go unused due to the fact that we pulled back rows.
137-
while (recordCount > 0)
137+
do
138138
{
139139
recordCount = await ReadRows(null);
140-
}
140+
} while (recordCount > 0);
141141
continue;
142142

143143
case SqlNotificationType.Change when depResult.Source is SqlNotificationSource.Timeout:

0 commit comments

Comments
 (0)