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

Method Close

tx.go:91–100  ·  view source on GitHub ↗

Close closes the transaction, releasing any open resources.

(ctx context.Context)

Source from the content-addressed store, hash-verified

89
90// Close closes the transaction, releasing any open resources.
91func (c *Tx) Close(ctx context.Context) error {
92 // UNWATCH is only needed while a WATCH is still active. EXEC discards the
93 // watched keys server-side on both commit and abort, so the common
94 // WATCH/.../EXEC paths leave nothing to release and avoid the extra round
95 // trip.
96 if c.watchArmed {
97 _ = c.Unwatch(ctx).Err()
98 }
99 return c.baseClient.Close()
100}
101
102// Watch marks the keys to be watched for conditional execution
103// of a transaction.

Callers

nothing calls this directly

Calls 3

UnwatchMethod · 0.95
ErrMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected