MCPcopy
hub / github.com/redis/go-redis / cmdInfoPeek

Method cmdInfoPeek

osscluster.go:2354–2359  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
2354func (c *ClusterClient) cmdInfoPeek(name string) *CommandInfo {
2355 if cmds := c.cmdsInfoCache.Peek(); cmds != nil {
2356 return cmds[name]
2357 }
2358 return nil
2359}
2360
2361func (c *ClusterClient) cmdSlot(cmd Cmder, prefferedSlot int) int {
2362 info := c.cmdInfoPeek(cmd.Name())

Callers 4

cmdSlotMethod · 0.95
executeMultiShardMethod · 0.95
createAggregatorMethod · 0.95
hasKeysMethod · 0.95

Calls 1

PeekMethod · 0.45

Tested by

no test coverage detected