@@ -156,7 +156,11 @@ func (s *developService) startNotebookTask() { | |||||
var payEndAt int64 | var payEndAt int64 | ||||
var payStatus api.BillingPayRecordStatus | var payStatus api.BillingPayRecordStatus | ||||
if utils.IsCompletedState(j.Status) { | if utils.IsCompletedState(j.Status) { | ||||
payEndAt = j.StoppedAt.Unix() | |||||
if j.StoppedAt == nil { | |||||
payEndAt = time.Now().Unix() | |||||
} else { | |||||
payEndAt = j.StoppedAt.Unix() | |||||
} | |||||
payStatus = api.BillingPayRecordStatus_BPRS_PAY_COMPLETED | payStatus = api.BillingPayRecordStatus_BPRS_PAY_COMPLETED | ||||
} else { | } else { | ||||
payEndAt = time.Now().Unix() | payEndAt = time.Now().Unix() | ||||
@@ -224,7 +228,7 @@ func (s *developService) startNotebookTask() { | |||||
state := utils.MapPhaseToState(typeJob.JobPhase(job.Status.State.Phase)) | state := utils.MapPhaseToState(typeJob.JobPhase(job.Status.State.Phase)) | ||||
if utils.IsCompletedState(nbJob.Status) || strings.EqualFold(nbJob.Status, state) { | |||||
if utils.IsCompletedState(nbJob.Status) { | |||||
continue | continue | ||||
} | } | ||||
@@ -259,7 +263,7 @@ func (s *developService) startNotebookTask() { | |||||
NotebookId: nb.Id, | NotebookId: nb.Id, | ||||
} | } | ||||
if strings.EqualFold(state, constant.RUNNING) { | |||||
if strings.EqualFold(state, constant.RUNNING) && strings.EqualFold(nbJob.Status, constant.PENDING) { | |||||
nbJobUp.StartedAt = &now | nbJobUp.StartedAt = &now | ||||
record.Type = commapi.NotebookEventRecordType_RUN | record.Type = commapi.NotebookEventRecordType_RUN | ||||
} else if utils.IsCompletedState(state) { | } else if utils.IsCompletedState(state) { | ||||
@@ -256,10 +256,8 @@ func (s *trainJobService) trainJobUpdateStaus(ctx context.Context) { | |||||
s.log.Warn(context.TODO(), "GetTrainJob err when onJobUpdate:"+job.Name, err) | s.log.Warn(context.TODO(), "GetTrainJob err when onJobUpdate:"+job.Name, err) | ||||
continue | continue | ||||
} | } | ||||
state := utils.MapPhaseToState(typeJob.JobPhase(job.Status.State.Phase)) | state := utils.MapPhaseToState(typeJob.JobPhase(job.Status.State.Phase)) | ||||
if utils.IsCompletedState(trainJob.Status) || strings.EqualFold(trainJob.Status, state) { | |||||
if utils.IsCompletedState(trainJob.Status) { | |||||
continue | continue | ||||
} | } | ||||
@@ -269,7 +267,7 @@ func (s *trainJobService) trainJobUpdateStaus(ctx context.Context) { | |||||
} | } | ||||
now := time.Now() | now := time.Now() | ||||
if strings.EqualFold(state, constant.RUNNING) { | |||||
if strings.EqualFold(state, constant.RUNNING) && strings.EqualFold(trainJob.Status, constant.PENDING) { | |||||
update.StartedAt = &now | update.StartedAt = &now | ||||
} else if utils.IsCompletedState(state) { | } else if utils.IsCompletedState(state) { | ||||
update.CompletedAt = &now | update.CompletedAt = &now | ||||
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》