Skip to content

Commit

Permalink
Close subscriber after each use
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Aug 1, 2023
1 parent 59492fc commit 7c6a0b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/adpub/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ func (c *client) Distance(ctx context.Context, oldestCid, newestCid cid.Cid) (in
if err != nil {
return 0, cid.Undef, err
}
defer sub.Close()

newestCid, err = sub.Sync(ctx, c.publisher, newestCid, sel)
if err != nil {
return 0, cid.Undef, err
Expand Down

0 comments on commit 7c6a0b5

Please sign in to comment.