Skip to content

Commit

Permalink
fix: fix redis lock
Browse files Browse the repository at this point in the history
  • Loading branch information
aldor007 authored Oct 20, 2022
1 parent 8d4c9a0 commit b1bbb6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/lock/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ func (m *RedisLock) Lock(ctx context.Context, key string) (result LockResult, ok
select {
case <-ch:
m.NotifyAndRelease(ctx, key, nil)
return
case <-result.Cancel:
m.memoryLock.Release(ctx, key)
pubsub.Close()
return
case <-ctx.Done():
m.memoryLock.Release(ctx, key)
pubsub.Close()
Expand Down

0 comments on commit b1bbb6d

Please sign in to comment.