Merge pull request #175 from camandel/api_logarchived

gateway: add api to get log status
This commit is contained in:
Simone Gotti 2019-11-13 11:45:31 +01:00 committed by GitHub
commit 9fd4b662a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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