diff --git a/docs/Scripting.md b/docs/Scripting.md index 56af7afc1..5ea20e380 100644 --- a/docs/Scripting.md +++ b/docs/Scripting.md @@ -35,10 +35,10 @@ Any object that exposes field or property members with the same name as @-prefix - RedisKey - RedisValue -StackExchange.Redis handles Lua script caching internally. It automatically transmits the Lua script to redis on the first call to 'ScriptEvaluate'. For further calls of the same script only the hash with [`EVALSHA`](https://redis.io/commands/evalsha) is used. +StackExchange.Redis handles Lua script caching internally. It automatically transmits the Lua script to redis on the first call to 'ScriptEvaluate'. For further calls of the same script [`EVAL`](https://redis.io/commands/eval) is used instead of [`EVALSHA`](https://redis.io/commands/evalsha), due to resiliency concerns. For more control of the Lua script transmission to redis, `LuaScript` objects can be converted into `LoadedLuaScript`s via `LuaScript.Load(IServer)`. -`LoadedLuaScripts` are evaluated with the [`EVALSHA`](https://redis.io/commands/evalsha), and referred to by hash. +`LoadedLuaScripts` are evaluated with the [`EVAL`](https://redis.io/commands/eval) command instead of [`EVALSHA`](https://redis.io/commands/evalsha), due to resiliency concerns. An example use of `LoadedLuaScript`: diff --git a/src/StackExchange.Redis/LuaScript.cs b/src/StackExchange.Redis/LuaScript.cs index 6e4ac7cd3..f4d3a5616 100644 --- a/src/StackExchange.Redis/LuaScript.cs +++ b/src/StackExchange.Redis/LuaScript.cs @@ -239,7 +239,7 @@ public sealed class LoadedLuaScript /// /// The SHA1 hash of ExecutableScript. - /// This is sent to Redis instead of ExecutableScript during Evaluate and EvaluateAsync calls. + /// This is not sent to Redis, instead ExecutableScript is used during Evaluate and EvaluateAsync calls. /// /// Be aware that using hash directly is not resilient to Redis server restarts. [EditorBrowsable(EditorBrowsableState.Never)] @@ -257,8 +257,8 @@ internal LoadedLuaScript(LuaScript original, byte[] hash) /// /// Evaluates this LoadedLuaScript against the given database, extracting parameters for the passed in object if any. /// - /// This method sends the SHA1 hash of the ExecutableScript instead of the script itself. - /// If the script has not been loaded into the passed Redis instance, it will fail. + /// This method evaluates the script itself and does not send the SHA-1 hash, generated by the server when loaded initially, in order to execute it. + /// If the script has not been loaded into the passed Redis instance, it will not fail. /// /// /// The redis database to evaluate against. @@ -275,8 +275,8 @@ public RedisResult Evaluate(IDatabase db, object? ps = null, RedisKey? withKeyPr /// /// Evaluates this LoadedLuaScript against the given database, extracting parameters for the passed in object if any. /// - /// This method sends the SHA1 hash of the ExecutableScript instead of the script itself. - /// If the script has not been loaded into the passed Redis instance, it will fail. + /// This method evaluates the script itself and does not send the SHA-1 hash, generated by the server when loaded initially, in order to execute it. + /// If the script has not been loaded into the passed Redis instance, it will not fail. /// /// /// The redis database to evaluate against.