Use context.WIthoutCancel when releasing locks
Fulfills a TODO. Makes it so locks can be released when shutting down/reloading.
This commit is contained in:
parent
8613f4a444
commit
23f868079e
@ -289,7 +289,7 @@ func acquireLock(ctx context.Context, storage Storage, lockKey string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func releaseLock(ctx context.Context, storage Storage, lockKey string) error {
|
func releaseLock(ctx context.Context, storage Storage, lockKey string) error {
|
||||||
err := storage.Unlock(context.TODO(), lockKey) // TODO: in Go 1.21, use WithoutCancel (see #247)
|
err := storage.Unlock(context.WithoutCancel(ctx), lockKey)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
locksMu.Lock()
|
locksMu.Lock()
|
||||||
delete(locks, lockKey)
|
delete(locks, lockKey)
|
||||||
|
Loading…
Reference in New Issue
Block a user