Merge pull request 'fix deployinstance bugs' (#277) from tzwang/pcm-coordinator:master into master

This commit is contained in:
tzwang 2024-07-27 16:17:06 +08:00
commit dddbe7cd18
1 changed files with 18 additions and 0 deletions

View File

@ -45,8 +45,14 @@ func UpdateDeployInstanceStatus(svc *svc.ServiceContext, instance *models.AiInfe
case storeLink.TYPE_OCTOPUS:
switch ins.Status {
case "running":
if instance.Status == constants.Running {
return
}
instance.Status = constants.Running
case "stopped":
if instance.Status == constants.Stopped {
return
}
instance.Status = constants.Stopped
default:
instance.Status = ins.Status
@ -54,8 +60,14 @@ func UpdateDeployInstanceStatus(svc *svc.ServiceContext, instance *models.AiInfe
case storeLink.TYPE_MODELARTS:
switch ins.Status {
case "running":
if instance.Status == constants.Running {
return
}
instance.Status = constants.Running
case "stopped":
if instance.Status == constants.Stopped {
return
}
instance.Status = constants.Stopped
default:
instance.Status = ins.Status
@ -63,8 +75,14 @@ func UpdateDeployInstanceStatus(svc *svc.ServiceContext, instance *models.AiInfe
case storeLink.TYPE_SHUGUANGAI:
switch ins.Status {
case "Running":
if instance.Status == constants.Running {
return
}
instance.Status = constants.Running
case "Terminated":
if instance.Status == constants.Stopped {
return
}
instance.Status = constants.Stopped
default:
instance.Status = ins.Status