Skip to content

Commit

Permalink
[bugfix] app-serving: fix wrong status update
Browse files Browse the repository at this point in the history
  • Loading branch information
robertchoi80 committed Jun 7, 2023
1 parent 7fecf95 commit 08564cf
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions internal/usecase/app-serve-app.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,27 +245,17 @@ func (u *AppServeAppUsecase) DeleteAppServeApp(appId string) (res string, err er
return "작업 진행 중에는 앱을 삭제할 수 없습니다", fmt.Errorf("Can't delete app while the task is in progress.")
}

log.Info("Updating app status to 'DELETING'..")

latestTaskId := app.AppServeAppTasks[0].ID
err = u.repo.UpdateStatus(appId, latestTaskId, "DELETING", "")
if err != nil {
log.Debug("appId = ", appId)
log.Debug("taskId = ", latestTaskId)
return "", fmt.Errorf("failed to update app status on PromoteAppServeApp. Err: %s", err)
}

/********************
* Start delete task *
********************/

appTask := &domain.AppServeAppTask{
AppServeAppId: app.ID,
Version: strconv.Itoa(len(app.AppServeAppTasks) + 1),
ArtifactUrl: app.AppServeAppTasks[len(app.AppServeAppTasks)-1].ArtifactUrl,
ImageUrl: app.AppServeAppTasks[len(app.AppServeAppTasks)-1].ImageUrl,
ArtifactUrl: "",
ImageUrl: app.AppServeAppTasks[0].ImageUrl,
Status: "DELETING",
Profile: app.AppServeAppTasks[len(app.AppServeAppTasks)-1].Profile,
Profile: app.AppServeAppTasks[0].Profile,
Output: "",
CreatedAt: time.Now(),
}
Expand Down

0 comments on commit 08564cf

Please sign in to comment.