close pubsub

This commit is contained in:
Andre Medeiros 2023-04-01 12:19:56 -04:00
parent f3e6d27372
commit 2dec2ff90e

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