-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
gredis cannot override Do method #3191
Comments
我觉得你要继承的应该是 gf/contrib/nosql/redis/redis.go Line 24 in ab5ab4c
而不是 gf/database/gredis/gredis_redis.go Line 19 in 5e72b03
github.com/gogf/gf/contrib/nosql/redis/v2 才是一个Redis Adapter实现。 |
I think what you want to inherit should be gf/contrib/nosql/redis/redis.go Line 24 in ab5ab4c
|
目前没有很好的办法处理这个问题,可能需要改进现有的实现。 |
There is currently no good way to deal with this problem, and existing implementations may need to be improved. |
@merlin888888 已经可以了,如果着急可以试试master分支。具体使用可以看#3194 |
@merlin888888 It’s already available. If you are in a hurry, you can try the master branch. For specific usage, see #3194 |
使用gredis调用g.redis().Do() 和g.redis().Hset() 方法最后调用的Do方法不一致,请问下为什么不通用上面的Do方法呢?这样可以在业务层实现重写Do方法,增加一些业务处理,如日志记录等需求。
当前继承Adapter,然后使用g.Redis().SetAdapter(),自己实现Do方法,只能覆盖g.redis().Do()一种场景,使用其它封装的命令无法覆盖Do方法。
The text was updated successfully, but these errors were encountered: