bsm / redislock

Simplified distributed locking implementation using Redis
Other
1.45k stars 157 forks source link

RedisClient error #49

Closed mertcakmak2 closed 2 years ago

mertcakmak2 commented 2 years ago

I try your example code but doesn't working.

Go version: go1.19.1 windows/amd64 redislock version in go mod file: github.com/bsm/redislock v0.8.0 redis version in go mod file: github.com/go-redis/redis/v9 v9.0.0-beta.3

I have error as below.

redislock.go:149:31: cannot use l.client.client (variable of type RedisClient) as type redis.Scripter in argument to luaPTTL.Run: RedisClient does not implement redis.Scripter (missing EvalRO method) C:\Users\P1608\go\pkg\mod\github.com\bsm\redislock@v0.8.0\redislock.go:166:37: cannot use l.client.client (variable of type RedisClient) as type redis.Scripter in argument to luaRefresh.Run: RedisClient does not implement redis.Scripter (missing EvalRO method) C:\Users\P1608\go\pkg\mod\github.com\bsm\redislock@v0.8.0\redislock.go:178:34: cannot use l.client.client (variable of type RedisClient) as type redis.Scripter in argument to luaRelease.Run: RedisClient does not implement redis.Scripter (missing EvalRO method)

dim commented 2 years ago

Duplicate of https://github.com/bsm/redislock/issues/46

dim commented 2 years ago

Apologies, I see it now, fixed in https://github.com/bsm/redislock/pull/50

dim commented 2 years ago

Pushed new release, thanks for reporting the issue

nmfzone commented 1 year ago

And now redislock drop support for go redis v8?

dim commented 1 year ago

@nmfzone the v8 branch of https://github.com/go-redis/redis is not being maintained by its author either but you can always pin your go.mod to 0.7.x version of this lib?

nmfzone commented 1 year ago

Yeah, I know. Well, if you can keep support for redis v8 then it's good, right? Since there is a lot users who still using v8, especially in production. #justmy2cent

dim commented 1 year ago

Sure, we can backport new features and release them as 0.7.x tags. Is there anything you are missing right now?

dim commented 1 year ago

Here you go, here's a new branch https://github.com/bsm/redislock/tree/0.7