From a9e54001393d6e9ac01bfaa0265d50135d1fb51c Mon Sep 17 00:00:00 2001 From: Mohammed Diaa Date: Fri, 26 Jul 2024 13:21:32 +0300 Subject: [PATCH 1/2] Process all available run objects no matter the status --- cmd/get/get.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/get/get.go b/cmd/get/get.go index a74ec2b..047b380 100644 --- a/cmd/get/get.go +++ b/cmd/get/get.go @@ -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" From 18a2ca3276b8019c4888f2c8a11a37918c2ea94c Mon Sep 17 00:00:00 2001 From: Mohammed Diaa Date: Fri, 26 Jul 2024 13:22:33 +0300 Subject: [PATCH 2/2] Handle "stopping" runs similarly to "stopped" runs --- cmd/execute/watch.go | 2 +- cmd/output/output.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/execute/watch.go b/cmd/execute/watch.go index ddb5590..52b0ddb 100644 --- a/cmd/execute/watch.go +++ b/cmd/execute/watch.go @@ -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 != "" { diff --git a/cmd/output/output.go b/cmd/output/output.go index 8a8d1ed..03a79bf 100644 --- a/cmd/output/output.go +++ b/cmd/output/output.go @@ -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