Browse Source

duration

tags/v1.22.1.3
lewis 3 years ago
parent
commit
9ab3174a69
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      routers/repo/cloudbrain.go

+ 7
- 0
routers/repo/cloudbrain.go View File

@@ -1010,6 +1010,13 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) {
for i, task := range ciTasks {
ciTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain)
ciTasks[i].Cloudbrain.ComputeResource = task.ComputeResource
var duration int64
if task.Status == string(models.JobRunning) {
duration = time.Now().Unix() - int64(task.Cloudbrain.CreatedUnix)
} else {
duration = int64(task.Cloudbrain.UpdatedUnix) - int64(task.Cloudbrain.CreatedUnix)
}
ciTasks[i].TrainJobDuration = util.AddZero(duration/3600000) + ":" + util.AddZero(duration%3600000/60000) + ":" + util.AddZero(duration%60000/1000)
}

pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5)


Loading…
Cancel
Save