pintracker: carry over attempt account only for operations of the same type
This commit is contained in:
parent
7cf40de354
commit
c4ca5b7abe
|
@ -83,8 +83,9 @@ func (opt *OperationTracker) TrackNewOperation(ctx context.Context, pin *api.Pin
|
|||
}
|
||||
|
||||
op2 := NewOperation(ctx, pin, typ, ph)
|
||||
if ok { // Carry over the attempt count.
|
||||
// The old operation exists and was cancelled.
|
||||
if ok && op.Type() == typ {
|
||||
// Carry over the attempt count when doing an operation of the
|
||||
// same type. The old operation exists and was cancelled.
|
||||
op2.attemptCount = op.AttemptCount() // carry the count
|
||||
}
|
||||
logger.Debugf("'%s' on cid '%s' has been created with phase '%s'", typ, pin.Cid, ph)
|
||||
|
|
Loading…
Reference in New Issue
Block a user