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

Method checkMovedErr

osscluster.go:1792–1817  ·  view source on GitHub ↗
(
	ctx context.Context, cmd Cmder, err error, failedCmds *cmdsMap,
)

Source from the content-addressed store, hash-verified

1790}
1791
1792func (c *ClusterClient) checkMovedErr(
1793 ctx context.Context, cmd Cmder, err error, failedCmds *cmdsMap,
1794) bool {
1795 moved, ask, addr := isMovedError(err)
1796 if !moved && !ask {
1797 return false
1798 }
1799
1800 node, err := c.nodes.GetOrCreate(addr)
1801 if err != nil {
1802 return false
1803 }
1804
1805 if moved {
1806 c.state.LazyReload()
1807 failedCmds.Add(node, cmd)
1808 return true
1809 }
1810
1811 if ask {
1812 failedCmds.Add(node, NewCmd(ctx, "asking"), cmd)
1813 return true
1814 }
1815
1816 panic("not reached")
1817}
1818
1819// TxPipeline acts like Pipeline, but wraps queued commands with MULTI/EXEC.
1820func (c *ClusterClient) TxPipeline() Pipeliner {

Callers 2

pipelineReadCmdsMethod · 0.95
txPipelineReadQueuedMethod · 0.95

Calls 5

isMovedErrorFunction · 0.85
NewCmdFunction · 0.85
GetOrCreateMethod · 0.80
LazyReloadMethod · 0.80
AddMethod · 0.65

Tested by

no test coverage detected