close pubsub

This commit is contained in:
Andre Medeiros 2023-04-01 12:19:56 -04:00
parent f3e6d27372
commit 2dec2ff90e
1 changed files with 1 additions and 0 deletions

View File

@ -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):