From a1a4d2031958959432e5f2eddbe3e37ca0c96cd3 Mon Sep 17 00:00:00 2001 From: yeya24 Date: Thu, 15 Aug 2019 16:22:43 +0800 Subject: [PATCH] update dfgettask status to success Signed-off-by: yeya24 --- supernode/daemon/mgr/task/manager_util.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/supernode/daemon/mgr/task/manager_util.go b/supernode/daemon/mgr/task/manager_util.go index 4e1fe414b..b7fa0b7ab 100644 --- a/supernode/daemon/mgr/task/manager_util.go +++ b/supernode/daemon/mgr/task/manager_util.go @@ -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