Always await instead of directly returning Task

https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AsyncGuidance.md#prefer-asyncawait-over-directly-returning-task

The performance impact is negligible (and it's me saying that!)
This commit is contained in:
Bond_009
2024-10-31 17:02:06 +01:00
parent 282784cbb6
commit d2db700402
14 changed files with 60 additions and 91 deletions

View File

@@ -276,11 +276,11 @@ namespace Emby.Server.Implementations.Session
/// </summary>
/// <param name="webSocket">The WebSocket.</param>
/// <returns>Task.</returns>
private Task SendForceKeepAlive(IWebSocketConnection webSocket)
private async Task SendForceKeepAlive(IWebSocketConnection webSocket)
{
return webSocket.SendAsync(
await webSocket.SendAsync(
new ForceKeepAliveMessage(WebSocketLostTimeout),
CancellationToken.None);
CancellationToken.None).ConfigureAwait(false);
}
}
}