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

Commit

Permalink
update dfgettask status to success
Browse files Browse the repository at this point in the history
Signed-off-by: yeya24 <[email protected]>
  • Loading branch information
yeya24 committed Aug 15, 2019
1 parent dbb029d commit a1a4d20
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions supernode/daemon/mgr/task/manager_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ func (tm *Manager) parseAvailablePeers(ctx context.Context, clientID string, tas
pieceSuccess, _ := tm.progressMgr.GetPieceProgressByCID(ctx, task.ID, clientID, "success")
logrus.Debugf("taskID: %s, get successful pieces: %v", task.ID, pieceSuccess)
if cdnSuccess && (int32(len(pieceSuccess)) == task.PieceTotal) {
// update dfget task status to success
if err := tm.dfgetTaskMgr.UpdateStatus(ctx, clientID, task.ID, types.DfGetTaskStatusSUCCESS); err != nil {
logrus.Errorf("failed to update dfget task status with "+
"taskID(%s) clientID(%s) status(%s): %v", task.ID, clientID, types.DfGetTaskStatusSUCCESS, err)
}
finishInfo := make(map[string]interface{})
finishInfo["md5"] = task.Md5
finishInfo["fileLength"] = task.FileLength
Expand Down

0 comments on commit a1a4d20

Please sign in to comment.