Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit a1a4d20

Browse files
committed
update dfgettask status to success
Signed-off-by: yeya24 <[email protected]>
1 parent dbb029d commit a1a4d20

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

supernode/daemon/mgr/task/manager_util.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ func (tm *Manager) parseAvailablePeers(ctx context.Context, clientID string, tas
324324
pieceSuccess, _ := tm.progressMgr.GetPieceProgressByCID(ctx, task.ID, clientID, "success")
325325
logrus.Debugf("taskID: %s, get successful pieces: %v", task.ID, pieceSuccess)
326326
if cdnSuccess && (int32(len(pieceSuccess)) == task.PieceTotal) {
327+
// update dfget task status to success
328+
if err := tm.dfgetTaskMgr.UpdateStatus(ctx, clientID, task.ID, types.DfGetTaskStatusSUCCESS); err != nil {
329+
logrus.Errorf("failed to update dfget task status with "+
330+
"taskID(%s) clientID(%s) status(%s): %v", task.ID, clientID, types.DfGetTaskStatusSUCCESS, err)
331+
}
327332
finishInfo := make(map[string]interface{})
328333
finishInfo["md5"] = task.Md5
329334
finishInfo["fileLength"] = task.FileLength

0 commit comments

Comments
 (0)