-
Notifications
You must be signed in to change notification settings - Fork 949
Open
Description
源码:
func (r Lock) Lock(key string, unixTsToExpireNs int64) error {
now := time.Now().UnixNano()
expiration := time.Duration(unixTsToExpireNs + 1 - now)
ctx := r.rclient.Context()
success, err := r.rclient.SetNX(ctx, key, unixTsToExpireNs, expiration).Result()
if err != nil {
return err
}
错误信息:
github.com/RichardKnop/machinery/v2/locks/redis
....\pkg\mod\github.com!richard!knop\machinery\[email protected]\locks\redis\redis.go:67:19: r.rclient.Context undefined (type "github.com/redis/go-redis/v9".UniversalClient has no field or method Context)
ctx := r.rclient.Context() 这行代码错误,我使用的是最新版本,没有context 方法
charleswhchan
Metadata
Metadata
Assignees
Labels
No labels