Skip to content

Commit

Permalink
fix: file peer task back source digest not match (#849)
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Ma <[email protected]>
  • Loading branch information
jim3ma authored Dec 1, 2021
1 parent 8d0ed54 commit 7f28389
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/daemon/peer/piece_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,6 @@ func (pm *pieceManager) DownloadSource(ctx context.Context, pt Task, request *sc
return storage.ErrShortRead
}
}
pt.SetTotalPieces(maxPieceNum)
if err := pt.SetContentLength(contentLength); err != nil {
log.Errorf("set content length failed %s", err)
}

if err := pm.storageManager.UpdateTask(ctx,
&storage.UpdateTaskRequest{
Expand All @@ -414,6 +410,10 @@ func (pm *pieceManager) DownloadSource(ctx context.Context, pt Task, request *sc
}); err != nil {
log.Errorf("update task failed %s", err)
}
if err := pt.SetContentLength(contentLength); err != nil {
log.Errorf("set content length failed %s", err)
}

log.Infof("download from source ok")
return nil
}

0 comments on commit 7f28389

Please sign in to comment.