Valkey was introduced as a dependency as part of the development of the M1, M2 and M6 sections of the TRL epic (#121) in PR (#796).
The code loaded Lua scripts using the EVAL command to execute the script with the parameters. This can impact performance as each flow will perform the same call.
It was suggested during the review to use the EVALSHA command instead, which uses a unique SHA for each script that is a 40 char long and uses the cached script in Valkey instead of processing the script per call.
The goal is to replace the EVAL with EVALSHA and implement a fallback to reload the script on failure (flush cache, for instance).
Valkey was introduced as a dependency as part of the development of the M1, M2 and M6 sections of the TRL epic (#121) in PR (#796).
The code loaded Lua scripts using the EVAL command to execute the script with the parameters. This can impact performance as each flow will perform the same call.
It was suggested during the review to use the EVALSHA command instead, which uses a unique SHA for each script that is a 40 char long and uses the cached script in Valkey instead of processing the script per call.
The goal is to replace the
EVALwithEVALSHAand implement a fallback to reload the script on failure (flush cache, for instance).