Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

fix: don't hold the pin lock while updating pins #2

Merged
merged 1 commit into from
Feb 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,11 @@ func (p *pinner) Update(ctx context.Context, from, to cid.Cid, unpin bool) error
return fmt.Errorf("'from' cid was not recursively pinned already")
}

// Temporarily unlock while we fetch the differences.
p.lock.Unlock()
err := dagutils.DiffEnumerate(ctx, p.dserv, from, to)
p.lock.Lock()

if err != nil {
return err
}
Expand Down