Skip to content

Commit 7f0bb4a

Browse files
authored
Merge pull request #122 from trickest/fix/get-workflow-status
Fix retrieval of stopped workflow runs in JSON format
2 parents 3016fad + 18a2ca3 commit 7f0bb4a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

cmd/execute/watch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func WatchRun(runID uuid.UUID, downloadPath string, nodesToDownload map[string]o
115115
return
116116
}
117117

118-
if run.Status == "COMPLETED" || run.Status == "STOPPED" || run.Status == "FAILED" {
118+
if run.Status == "COMPLETED" || run.Status == "STOPPED" || run.Status == "STOPPING" || run.Status == "FAILED" {
119119
if downloadPath == "" {
120120
downloadPath = run.SpaceName
121121
if run.ProjectName != "" {

cmd/get/get.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var GetCmd = &cobra.Command{
5858
run := execute.GetRunByID(runUUID)
5959
runs = []types.Run{*run}
6060
}
61-
if len(runs) > 0 && (runs[0].Status == "RUNNING" || runs[0].Status == "COMPLETED") {
61+
if len(runs) > 0 {
6262
run := runs[0]
6363
if run.Status == "COMPLETED" && run.CompletedDate.IsZero() {
6464
run.Status = "RUNNING"

cmd/output/output.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func init() {
163163
}
164164

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

0 commit comments

Comments
 (0)