diff --git a/src/StackExchange.Redis/ServerEndPoint.cs b/src/StackExchange.Redis/ServerEndPoint.cs index d59e6b090..2c874993c 100644 --- a/src/StackExchange.Redis/ServerEndPoint.cs +++ b/src/StackExchange.Redis/ServerEndPoint.cs @@ -1071,17 +1071,17 @@ private async Task HandshakeAsync(PhysicalConnection connection, ILogger? log) await connection.FlushAsync().ForAwait(); } - private async Task SendAuthMessageAsync(PhysicalConnection connection, Message msg, ResultProcessor demandOK) + private ValueTask SendAuthMessageAsync(PhysicalConnection connection, Message msg, ResultProcessor demandOK) { if (Multiplexer.RawConfig.WaitForAuth) { - await WriteDirectAsync(msg, ResultProcessor.DemandOK).ForAwait(); + return new ValueTask(WriteDirectAsync(msg, ResultProcessor.DemandOK)); } else { msg.Flags = CommandFlags.FireAndForget; msg.SetInternalCall(); - await WriteDirectOrQueueFireAndForgetAsync(connection, msg, ResultProcessor.DemandOK).ForAwait(); + return WriteDirectOrQueueFireAndForgetAsync(connection, msg, ResultProcessor.DemandOK); } }