Fix #1785: Ensure up-to-date status for re-pinned items.

This commit is contained in:
Hector Sanjuan 2023-03-03 18:44:39 +01:00
parent d1dd3242f9
commit 9dcf0bdd9a
2 changed files with 3 additions and 2 deletions

View File

@ -56,7 +56,6 @@ type Operation struct {
tracker *OperationTracker
// RO fields
opType OperationType
pin api.Pin

View File

@ -86,7 +86,9 @@ func (opt *OperationTracker) TrackNewOperation(ctx context.Context, pin api.Pin,
if ok { // operation exists for the CID
if op.Type() == typ && op.Phase() != PhaseError && op.Phase() != PhaseDone {
// an ongoing operation of the same
// type. i.e. pinning, or queued.
// type. i.e. pinning, or queued. Update the pin
// object though, as it may have different options.
op.pin = pin
return nil
}
// i.e. operations in error phase