MCPcopy
hub / github.com/go-redsync/redsync / WithSetNXOnExtend

Function WithSetNXOnExtend

redsync.go:97–101  ·  view source on GitHub ↗

WithSetNXOnExtend improves extending logic to extend the key if exist and if not, tries to set a new key in redis Useful if your redises restart often and you want to reduce the chances of losing the lock Read this MR for more info: https://github.com/go-redsync/redsync/pull/149

()

Source from the content-addressed store, hash-verified

95// Useful if your redises restart often and you want to reduce the chances of losing the lock
96// Read this MR for more info: https://github.com/go-redsync/redsync/pull/149
97func WithSetNXOnExtend() Option {
98 return OptionFunc(func(m *Mutex) {
99 m.setNXOnExtend = true
100 })
101}
102
103// WithRetryDelayFunc can be used to override default delay behavior.
104func WithRetryDelayFunc(delayFunc DelayFunc) Option {

Callers

nothing calls this directly

Calls 1

OptionFuncFuncType · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…