MCPcopy
hub / github.com/bsm/redislock / Release

Method Release

redislock.go:272–284  ·  view source on GitHub ↗

Release manually releases the lock. May return ErrLockNotHeld.

(ctx context.Context)

Source from the content-addressed store, hash-verified

270// Release manually releases the lock.
271// May return ErrLockNotHeld.
272func (l *Lock) Release(ctx context.Context) error {
273 if l == nil {
274 return ErrLockNotHeld
275 }
276 _, err := luaRelease.Run(ctx, l.client, l.keys, l.value).Result()
277 if err != nil {
278 if errors.Is(err, redis.Nil) {
279 return ErrLockNotHeld
280 }
281 return err
282 }
283 return nil
284}
285
286// --------------------------------------------------------------------
287

Callers 15

ExampleFunction · 0.80
TestClientFunction · 0.80
TestObtainFunction · 0.80
TestObtain_metadataFunction · 0.80
TestObtain_custom_tokenFunction · 0.80
TestObtain_retry_successFunction · 0.80
TestObtain_retry_failureFunction · 0.80
TestLock_RefreshFunction · 0.80

Calls

no outgoing calls

Tested by 15

ExampleFunction · 0.64
TestClientFunction · 0.64
TestObtainFunction · 0.64
TestObtain_metadataFunction · 0.64
TestObtain_custom_tokenFunction · 0.64
TestObtain_retry_successFunction · 0.64
TestObtain_retry_failureFunction · 0.64
TestLock_RefreshFunction · 0.64