Skip to content

Commit

Permalink
Make Publisher.Close concurrent safe
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Jan 30, 2024
1 parent 5786367 commit ddcb8f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dagsync/ipnisync/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ func (p *Publisher) SetRoot(c cid.Cid) {

// Close closes the Publisher.
func (p *Publisher) Close() error {
p.lock.Lock()
defer p.lock.Unlock()

if p.pubHost != nil {
err := p.pubHost.Close()
p.pubHost = nil
Expand Down

0 comments on commit ddcb8f9

Please sign in to comment.