keon94 commented on code in PR #2455:
URL: https://github.com/apache/incubator-devlake/pull/2455#discussion_r935084382


##########
runner/run_task.go:
##########
@@ -292,3 +301,28 @@ func UpdateProgressDetail(db *gorm.DB, logger core.Logger, 
taskId uint64, progre
                progressDetail.SubTaskNumber = p.SubTaskNumber
        }
 }
+
+func runSubtask(
+       parentID uint64,
+       ctx core.SubTaskContext,
+       entryPoint core.SubTaskEntryPoint,
+) (*models.Subtask, error) {
+       beginAt := time.Now()
+       subtask := &models.Subtask{
+               Name:    ctx.GetName(),
+               TaskID:  parentID,
+               BeganAt: &beginAt,
+       }
+       defer func() {
+               finishedAt := time.Now()
+               subtask.FinishedAt = &finishedAt
+               subtask.SpentSeconds = finishedAt.Unix() - beginAt.Unix()

Review Comment:
   Made the change



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to