Skip to content

Commit

Permalink
Use fresh context for Unlock (fix #247)
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Aug 9, 2023
1 parent 8fac0d0 commit 37f5766
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func acquireLock(ctx context.Context, storage Storage, lockKey string) error {
}

func releaseLock(ctx context.Context, storage Storage, lockKey string) error {
err := storage.Unlock(ctx, lockKey)
err := storage.Unlock(context.TODO(), lockKey) // TODO: in Go 1.21, use WithoutCancel (see #247)

This comment has been minimized.

Copy link
@francislavoie

francislavoie Mar 5, 2024

Member

We can update this now, Caddy has 1.21 minimum

This comment has been minimized.

Copy link
@mholt

mholt Mar 5, 2024

Author Member

Done, thanks

if err == nil {
locksMu.Lock()
delete(locks, lockKey)
Expand Down

0 comments on commit 37f5766

Please sign in to comment.