weldr/store/compose: store information exposed in the API
Use the exact same status strings as is used in the API, making it clearer that they are the same (and avoiding any translation). Remember the creation/start/finish timestamps. And store the output type. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
6c49acbd51
commit
96f3cbf655
4 changed files with 38 additions and 17 deletions
|
|
@ -136,10 +136,10 @@ func (api *API) updateJobHandler(writer http.ResponseWriter, request *http.Reque
|
|||
err = json.NewDecoder(request.Body).Decode(&body)
|
||||
if err != nil {
|
||||
statusResponseError(writer, http.StatusBadRequest, "invalid status: "+err.Error())
|
||||
} else if body.Status == "running" {
|
||||
} else if body.Status == "RUNNING" {
|
||||
api.jobStatus <- job.Status{ComposeID: id, Status: body.Status}
|
||||
statusResponseOK(writer)
|
||||
} else if body.Status == "finished" {
|
||||
} else if body.Status == "FINISHED" {
|
||||
api.jobStore.DeleteJob(id)
|
||||
statusResponseOK(writer)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue