gateway: add api to get log status

This commit is contained in:
Carlo Mandelli 2019-11-12 12:06:55 +01:00
parent 24a9563872
commit 8ed813e722
2 changed files with 7 additions and 1 deletions

View File

@ -111,6 +111,11 @@ func createRunTaskResponse(rt *rstypes.RunTask, rct *rstypes.RunConfigTask) *gwa
} }
rcts := rct.Steps[i] rcts := rct.Steps[i]
rts := rt.Steps[i] rts := rt.Steps[i]
if rts.LogPhase == rstypes.RunTaskFetchPhaseFinished {
s.LogArchived = true
}
switch rcts := rcts.(type) { switch rcts := rcts.(type) {
case *rstypes.RunStep: case *rstypes.RunStep:
s.Type = "run" s.Type = "run"
@ -124,7 +129,6 @@ func createRunTaskResponse(rt *rstypes.RunTask, rct *rstypes.RunConfigTask) *gwa
s.Shell = shell s.Shell = shell
s.ExitStatus = rts.ExitStatus s.ExitStatus = rts.ExitStatus
case *rstypes.SaveToWorkspaceStep: case *rstypes.SaveToWorkspaceStep:
s.Type = "save_to_workspace" s.Type = "save_to_workspace"
s.Name = "save to workspace" s.Name = "save to workspace"

View File

@ -106,6 +106,8 @@ type RunTaskResponseStep struct {
StartTime *time.Time `json:"start_time"` StartTime *time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time"` EndTime *time.Time `json:"end_time"`
LogArchived bool `json:"log_archived"`
} }
type RunActionType string type RunActionType string