mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 11:47:36 +08:00
return when update deploy version
This commit is contained in:
parent
59ae05e9ca
commit
cebc6302c9
@ -307,7 +307,9 @@ func (e *exectorManager) buildFromImage(task *pb.TaskMessage) {
|
||||
for k, v := range i.Configs {
|
||||
configs[k] = v.String()
|
||||
}
|
||||
e.UpdateDeployVersion(i.ServiceID, i.DeployVersion)
|
||||
if err := e.UpdateDeployVersion(i.ServiceID, i.DeployVersion); err != nil {
|
||||
break
|
||||
}
|
||||
err = e.sendAction(i.TenantID, i.ServiceID, i.EventID, i.DeployVersion, i.Action, configs, i.Logger)
|
||||
if err != nil {
|
||||
i.Logger.Error("Send upgrade action failed", map[string]string{"step": "callback", "status": "failure"})
|
||||
@ -365,7 +367,9 @@ func (e *exectorManager) buildFromSourceCode(task *pb.TaskMessage) {
|
||||
for k, v := range i.Configs {
|
||||
configs[k] = v.String()
|
||||
}
|
||||
e.UpdateDeployVersion(i.ServiceID, i.DeployVersion)
|
||||
if err := e.UpdateDeployVersion(i.ServiceID, i.DeployVersion); err != nil {
|
||||
return
|
||||
}
|
||||
err = e.sendAction(i.TenantID, i.ServiceID, i.EventID, i.DeployVersion, i.Action, configs, i.Logger)
|
||||
if err != nil {
|
||||
i.Logger.Error("Send upgrade action failed", map[string]string{"step": "callback", "status": "failure"})
|
||||
@ -407,7 +411,9 @@ func (e *exectorManager) buildFromMarketSlug(task *pb.TaskMessage) {
|
||||
i.Logger.Error("Build app version from market slug failure", map[string]string{"step": "callback", "status": "failure"})
|
||||
}
|
||||
} else {
|
||||
e.UpdateDeployVersion(i.ServiceID, i.DeployVersion)
|
||||
if err := e.UpdateDeployVersion(i.ServiceID, i.DeployVersion); err != nil {
|
||||
break
|
||||
}
|
||||
err = e.sendAction(i.TenantID, i.ServiceID, i.EventID, i.DeployVersion, i.Action, i.Configs, i.Logger)
|
||||
if err != nil {
|
||||
i.Logger.Error("Send upgrade action failed", map[string]string{"step": "callback", "status": "failure"})
|
||||
@ -583,10 +589,11 @@ func (e *exectorManager) GetCurrentConcurrentTask() float64 {
|
||||
return float64(len(e.tasks))
|
||||
}
|
||||
|
||||
func (e *exectorManager) UpdateDeployVersion(serviceID, newVersion string) {
|
||||
func (e *exectorManager) UpdateDeployVersion(serviceID, newVersion string) error {
|
||||
if err := db.GetManager().TenantServiceDao().UpdateDeployVersion(serviceID, newVersion); err != nil {
|
||||
logrus.Errorf("Update app service deploy version failure %s, service %s do not auto upgrade", err.Error(), serviceID)
|
||||
} else {
|
||||
logrus.Debugf("Update app service deploy version %s success", newVersion)
|
||||
return err
|
||||
}
|
||||
logrus.Debugf("Update app service deploy version %s success", newVersion)
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user