Skip to content

Commit

Permalink
Merge pull request #122 from trickest/fix/get-workflow-status
Browse files Browse the repository at this point in the history
Fix retrieval of stopped workflow runs in JSON format
  • Loading branch information
mhmdiaa authored Jul 26, 2024
2 parents 3016fad + 18a2ca3 commit 7f0bb4a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/execute/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func WatchRun(runID uuid.UUID, downloadPath string, nodesToDownload map[string]o
return
}

if run.Status == "COMPLETED" || run.Status == "STOPPED" || run.Status == "FAILED" {
if run.Status == "COMPLETED" || run.Status == "STOPPED" || run.Status == "STOPPING" || run.Status == "FAILED" {
if downloadPath == "" {
downloadPath = run.SpaceName
if run.ProjectName != "" {
Expand Down
2 changes: 1 addition & 1 deletion cmd/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var GetCmd = &cobra.Command{
run := execute.GetRunByID(runUUID)
runs = []types.Run{*run}
}
if len(runs) > 0 && (runs[0].Status == "RUNNING" || runs[0].Status == "COMPLETED") {
if len(runs) > 0 {
run := runs[0]
if run.Status == "COMPLETED" && run.CompletedDate.IsZero() {
run.Status = "RUNNING"
Expand Down
2 changes: 1 addition & 1 deletion cmd/output/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func init() {
}

func DownloadRunOutput(run *types.Run, nodes map[string]NodeInfo, files []string, destinationPath string) {
if run.Status != "COMPLETED" && run.Status != "STOPPED" && run.Status != "FAILED" {
if run.Status != "COMPLETED" && run.Status != "STOPPED" && run.Status != "STOPPING" && run.Status != "FAILED" {
fmt.Println("The workflow run hasn't been completed yet!")
fmt.Println("Run ID: " + run.ID.String() + " Status: " + run.Status)
return
Expand Down

0 comments on commit 7f0bb4a

Please sign in to comment.