Skip to content
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.

Commit

Permalink
add result endpoint to log
Browse files Browse the repository at this point in the history
  • Loading branch information
PatWie committed May 5, 2019
1 parent e26dc9b commit ece2f96
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions api/worker/submission_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,22 +319,24 @@ func (h *RealSubmissionHandler) Handle(body []byte) error {
r.Header.Add("Authorization", "Bearer "+msg.AccessToken)

DefaultLogger.WithFields(logrus.Fields{
"submissionID": msg.SubmissionID,
"exitcode": exit,
"image": msg.DockerImage,
"submissionID": msg.SubmissionID,
"exitcode": exit,
"image": msg.DockerImage,
"resultEndpointURL": msg.ResultEndpointURL,
}).Info("send result to backend")

// run request
client := newHTTPClientSingleRequest()
resp, err := client.Do(r)
if err != nil {
DefaultLogger.WithFields(logrus.Fields{
"action": "send result to backend",
"submissionID": msg.SubmissionID,
"stdout": stdout,
"exitcode": exit,
"resp": resp,
"image": msg.DockerImage,
"action": "send result to backend",
"submissionID": msg.SubmissionID,
"ResultEndpointURL": msg.ResultEndpointURL,
"stdout": stdout,
"exitcode": exit,
"resp": resp,
"image": msg.DockerImage,
}).Warn(err)

return err
Expand Down

0 comments on commit ece2f96

Please sign in to comment.