|
|
|
@@ -2,7 +2,6 @@ package repo |
|
|
|
|
|
|
|
import ( |
|
|
|
"bufio" |
|
|
|
"code.gitea.io/gitea/modules/grampus" |
|
|
|
"encoding/json" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
@@ -16,6 +15,8 @@ import ( |
|
|
|
"time" |
|
|
|
"unicode/utf8" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/grampus" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/timeutil" |
|
|
|
"github.com/unknwon/i18n" |
|
|
|
|
|
|
|
@@ -573,7 +574,9 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo |
|
|
|
if task.TrainJobDuration == "" { |
|
|
|
if task.Duration == 0 { |
|
|
|
var duration int64 |
|
|
|
if task.Status == string(models.JobRunning) { |
|
|
|
if task.Status == string(models.JobWaiting) { |
|
|
|
duration = 0 |
|
|
|
} else if task.Status == string(models.JobRunning) { |
|
|
|
duration = time.Now().Unix() - int64(task.CreatedUnix) |
|
|
|
} else { |
|
|
|
duration = int64(task.UpdatedUnix) - int64(task.CreatedUnix) |
|
|
|
|