Skip to content

Add RunLoad to script #2604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add RunLoad to script #2604

wants to merge 1 commit into from

Conversation

simao
Copy link

@simao simao commented May 22, 2023

Add new RunLoad method to Script. It tries to run the script using EvalSha, if that fails, it loads the script using SCRIPTLOAD and then tries again.

This is what the redis manual recommends libraries to do:

From https://redis.io/docs/manual/programmability/eval-intro/

In this case, the application should first load it with SCRIPT LOAD
and then call EVALSHA once more to run the cached script by its SHA1
sum. Most of Redis' clients already provide utility APIs for doing
that automatically. Please consult your client's documentation
regarding the specific details

Please let me know if you think this should be merged, I will write some tests.

Add new `RunLoad` method to Script. It tries to run the script using
`EvalSha`, if that fails, it loads the script using SCRIPTLOAD and
then tries again.

This is what the redis manual recommends libraries to do:

From https://redis.io/docs/manual/programmability/eval-intro/

> In this case, the application should first load it with SCRIPT LOAD
> and then call EVALSHA once more to run the cached script by its SHA1
> sum. Most of Redis' clients already provide utility APIs for doing
> that automatically. Please consult your client's documentation
> regarding the specific details
@ofekshenawa
Copy link
Collaborator

ofekshenawa commented Apr 23, 2025

Hey @simao, Before we merge, could you write unit tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants