mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-21 19:37:41 +00:00
close pubsub
This commit is contained in:
parent
f3e6d27372
commit
2dec2ff90e
1 changed files with 1 additions and 0 deletions
|
@ -71,6 +71,7 @@ func (d *DistributedLock) WaitAcquireLock(ctx context.Context, key string, timeo
|
|||
|
||||
ch := fmt.Sprintf(lockTopicFormat, key)
|
||||
pubsub := d.client.Subscribe(ctx, ch)
|
||||
defer func() { _ = pubsub.Close() }()
|
||||
|
||||
select {
|
||||
case <-time.After(timeout):
|
||||
|
|
Loading…
Reference in a new issue