Skip to content

Commit

Permalink
Merge pull request #175 from camandel/api_logarchived
Browse files Browse the repository at this point in the history
gateway: add api to get log status
  • Loading branch information
sgotti committed Nov 13, 2019
2 parents 4497e19 + 8ed813e commit 9fd4b66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/services/gateway/api/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ func createRunTaskResponse(rt *rstypes.RunTask, rct *rstypes.RunConfigTask) *gwa
}
rcts := rct.Steps[i]
rts := rt.Steps[i]

if rts.LogPhase == rstypes.RunTaskFetchPhaseFinished {
s.LogArchived = true
}

switch rcts := rcts.(type) {
case *rstypes.RunStep:
s.Type = "run"
Expand All @@ -124,7 +129,6 @@ func createRunTaskResponse(rt *rstypes.RunTask, rct *rstypes.RunConfigTask) *gwa
s.Shell = shell

s.ExitStatus = rts.ExitStatus

case *rstypes.SaveToWorkspaceStep:
s.Type = "save_to_workspace"
s.Name = "save to workspace"
Expand Down
2 changes: 2 additions & 0 deletions services/gateway/api/types/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ type RunTaskResponseStep struct {

StartTime *time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time"`

LogArchived bool `json:"log_archived"`
}

type RunActionType string
Expand Down

0 comments on commit 9fd4b66

Please sign in to comment.