Skip to content

Commit

Permalink
bugfix: disable rollback of latest task
Browse files Browse the repository at this point in the history
  • Loading branch information
robertchoi80 committed May 7, 2024
1 parent 9612480 commit 8326bac
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions internal/delivery/http/app-serve-app.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,16 @@ func (h *AppServeAppHandler) GetAppServeAppTaskDetail(w http.ResponseWriter, r *
return
}

// TODO: this should be false for latest task
if strings.Contains(task.Status, "SUCCESS") && task.Status != "ABORT_SUCCESS" &&
// Workaround: Compare task ID with latest task ID
// Mark latest task with additional flag later
latestTask, err := h.usecase.GetAppServeAppLatestTask(r.Context(), appId)
if err != nil {
ErrorJSON(w, r, httpErrors.NewInternalServerError(err, "", ""))
return
}
if taskId == latestTask.ID {
task.AvailableRollback = false
} else if strings.Contains(task.Status, "SUCCESS") && task.Status != "ABORT_SUCCESS" &&
task.Status != "ROLLBACK_SUCCESS" {
task.AvailableRollback = true
}
Expand Down

0 comments on commit 8326bac

Please sign in to comment.