cmdInfoPeek returns the cached CommandInfo for the named command without triggering a round-trip to Redis. It returns nil when the cache is cold.
(name string)
| 2352 | // cmdInfoPeek returns the cached CommandInfo for the named command without |
| 2353 | // triggering a round-trip to Redis. It returns nil when the cache is cold. |
| 2354 | func (c *ClusterClient) cmdInfoPeek(name string) *CommandInfo { |
| 2355 | if cmds := c.cmdsInfoCache.Peek(); cmds != nil { |
| 2356 | return cmds[name] |
| 2357 | } |
| 2358 | return nil |
| 2359 | } |
| 2360 | |
| 2361 | func (c *ClusterClient) cmdSlot(cmd Cmder, prefferedSlot int) int { |
| 2362 | info := c.cmdInfoPeek(cmd.Name()) |
no test coverage detected