Skip to content

Commit 23f8680

Browse files
committed
Use context.WIthoutCancel when releasing locks
Fulfills a TODO. Makes it so locks can be released when shutting down/reloading.
1 parent 8613f4a commit 23f8680

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

storage.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func acquireLock(ctx context.Context, storage Storage, lockKey string) error {
289289
}
290290

291291
func releaseLock(ctx context.Context, storage Storage, lockKey string) error {
292-
err := storage.Unlock(context.TODO(), lockKey) // TODO: in Go 1.21, use WithoutCancel (see #247)
292+
err := storage.Unlock(context.WithoutCancel(ctx), lockKey)
293293
if err == nil {
294294
locksMu.Lock()
295295
delete(locks, lockKey)

0 commit comments

Comments
 (0)