1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Execute "COMMAND" command only when readonly (#2815)

* remove command command from oss cluster

* remove command command from oss cluster

* remove cmdInfo from ring

---------

Co-authored-by: Chayim <chayim@users.noreply.github.com>
This commit is contained in:
ofekshenawa
2023-12-17 15:21:01 +02:00
committed by GitHub
parent 8c695488a2
commit 86c68be278
4 changed files with 11 additions and 36 deletions

View File

@ -59,14 +59,6 @@ func NewClusterClientStub(resp []byte) *ClientStub {
},
})
// init command.
tmpClient := NewClient(&Options{Addr: ":6379"})
cmdsInfo, err := tmpClient.Command(ctx).Result()
_ = tmpClient.Close()
client.cmdsInfoCache = newCmdsInfoCache(func(_ context.Context) (map[string]*CommandInfo, error) {
return cmdsInfo, err
})
stub.Cmdable = client
return stub
}