rueidis icon indicating copy to clipboard operation
rueidis copied to clipboard

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

Open rueian opened this issue 1 year ago • 5 comments

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

https://github.com/redis/rueidis/blob/0124d4a3cc7c3a8d5f61aa6033481e160fd37f10/rueidisaside/aside.go#L141

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 avatar Jun 11 '24 15:06 rueian

Made the changes ✅

JayChavan-23 avatar Jun 12 '24 10:06 JayChavan-23

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

rueian avatar Jun 12 '24 11:06 rueian

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 avatar Jun 12 '24 11:06 JayChavan-23

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

Raised first one, please check. Thank you.

JayChavan-23 avatar Jun 12 '24 12:06 JayChavan-23

Working on this with @JayChavan-23

LegendHawk27 avatar Jun 13 '24 01:06 LegendHawk27

I think this can be closed now @rueian

SoulPancake avatar Feb 02 '25 07:02 SoulPancake