diff options
| author | Bond_009 <bond.009@outlook.com> | 2024-10-31 17:02:06 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2024-10-31 17:02:06 +0100 |
| commit | d2db7004024c6bbdd541a381c673f1e0b0aebfcb (patch) | |
| tree | 48d21b619b13c73fc85988d7c0b33a816b4f2c02 /Emby.Server.Implementations/Session | |
| parent | 282784cbb6fe203b87a6f2c673454ac8d3da82fa (diff) | |
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!)
Diffstat (limited to 'Emby.Server.Implementations/Session')
| -rw-r--r-- | Emby.Server.Implementations/Session/SessionWebSocketListener.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs index aba51de8f..75a50f7f5 100644 --- a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs +++ b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs @@ -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); } } } |
