|
|
|
@@ -6,6 +6,7 @@ |
|
|
|
package repo |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.gitea.io/gitea/modules/timeutil" |
|
|
|
"net/http" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
@@ -67,8 +68,14 @@ func GetModelArtsNotebook2(ctx *context.APIContext) { |
|
|
|
ctx.NotFound(err) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if job.StartTime == 0 { |
|
|
|
job.StartTime = timeutil.TimeStamp(result.Lease.CreateTime / 1000) |
|
|
|
} |
|
|
|
job.Status = result.Status |
|
|
|
if job.EndTime == 0 && job.Status == string(models.ModelArtsStopped) { |
|
|
|
job.EndTime = timeutil.TimeStampNow() |
|
|
|
job.Duration = job.ComputeDuration() |
|
|
|
} |
|
|
|
err = models.UpdateJob(job) |
|
|
|
if err != nil { |
|
|
|
log.Error("UpdateJob failed:", err) |
|
|
|
|