Proper backend API usage with shuffle-shared

This commit is contained in:
frikky
2023-02-27 02:35:41 +01:00
parent 3ed4d86a3b
commit ee32c093d5
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -462,7 +462,8 @@ func handleWorkflowQueue(resp http.ResponseWriter, request *http.Request) {
//log.Printf("Actionresult unmarshal: %s", string(body))
log.Printf("[DEBUG] Got workflow result from %s of length %d.", request.RemoteAddr, len(body))
err = shuffle.ValidateNewWorkerExecution(body)
ctx := context.Background()
err = shuffle.ValidateNewWorkerExecution(ctx, body)
if err == nil {
resp.WriteHeader(200)
resp.Write([]byte(fmt.Sprintf(`{"success": true, "reason": "success"}`)))
@@ -488,7 +489,6 @@ func handleWorkflowQueue(resp http.ResponseWriter, request *http.Request) {
// 4. Push to db
// IF FAIL: Set executionstatus: abort or cancel
ctx := context.Background()
workflowExecution, err := shuffle.GetWorkflowExecution(ctx, actionResult.ExecutionId)
if err != nil {
log.Printf("[ERROR] Failed getting execution (workflowqueue) %s: %s", actionResult.ExecutionId, err)