Skip to content

Commit

Permalink
Merge pull request Netflix#1942 from djcass44/fix-goclient-ack
Browse files Browse the repository at this point in the history
Added missing params to Go client Ack
  • Loading branch information
apanicker-nflx authored Nov 4, 2020
2 parents a08b8da + 2353871 commit c1251e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions client/go/conductorhttpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,14 @@ func (c *ConductorHttpClient) PollForTask(taskType string, workerid string, doma
}
}

func (c *ConductorHttpClient) AckTask(taskId string) (string, error) {
func (c *ConductorHttpClient) AckTask(taskId, workerid, domain string) (string, error) {
url := c.httpClient.MakeUrl("/tasks/{taskId}/ack", "{taskId}", taskId)
params := map[string]string{
"workerid": workerid,
"domain": domain,
}
headers := map[string]string{"Accept": "application/json"}
outputString, err := c.httpClient.Post(url, nil, headers, "")
outputString, err := c.httpClient.Post(url, params, headers, "")
if err != nil {
return "", err
}
Expand Down
2 changes: 1 addition & 1 deletion client/go/conductorworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (c *ConductorWorker) PollAndExecute(taskType string, domain string, execute
}

// Found a task, so we send an Ack
_, ackErr := c.ConductorHttpClient.AckTask(parsedTask.TaskId)
_, ackErr := c.ConductorHttpClient.AckTask(parsedTask.TaskId, hostname, domain)
if ackErr != nil {
log.Println("Error Acking task:", ackErr.Error())
continue
Expand Down

0 comments on commit c1251e8

Please sign in to comment.