Skip to content
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

Replace SET NX GET in rueidisaside with Lua when using Redis < 7 #560

Open
rueian opened this issue Jun 11, 2024 · 5 comments
Open

Replace SET NX GET in rueidisaside with Lua when using Redis < 7 #560

rueian opened this issue Jun 11, 2024 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@rueian
Copy link
Collaborator

rueian commented Jun 11, 2024

Currently, rueidisaside uses the latest syntax SET NX GET to acquire a lock before populating values to be cached.

val, err = c.client.Do(ctx, c.client.B().Set().Key(key).Value(id).Nx().Get().Px(ttl).Build()).ToString()

The latest syntax is the cause that makes rueidisaside support only Redis >= 7. It would be nice if we had an option to config rueidisaside to use a Lua script instead of the SET NX GET, so that we could support more users with old Redis.

@rueian rueian added enhancement New feature or request good first issue Good for newcomers labels Jun 11, 2024
@JayChavan-23
Copy link
Contributor

Made the changes ✅

@rueian
Copy link
Collaborator Author

rueian commented Jun 12, 2024

Hi @JayChavan-23, thanks! But please make it another pull request.

@JayChavan-23
Copy link
Contributor

Hi @JayChavan-23, thanks! But please make it another pull request.

I will raise one PR for issue #554, and then a second PR for this particular issue after the first one is merged.

@JayChavan-23
Copy link
Contributor

JayChavan-23 commented Jun 12, 2024

Hi @JayChavan-23, thanks! But please make it another pull request.

Raised first one, please check.
Thank you.

@LegendHawk27
Copy link

Working on this with @JayChavan-23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants