Skip to content

Commit

Permalink
add session ID to queue update payload
Browse files Browse the repository at this point in the history
  • Loading branch information
khash committed Sep 24, 2020
1 parent a181ef8 commit e514d76
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,19 @@ func (c *Client) PopQueue(queueName string) (json.RawMessage, error) {
return queueRes, nil
}

func (c *Client) UpdateQueue(queueName string, taskUUID string, state string, runResult string) (json.RawMessage, error) {
func (c *Client) UpdateQueue(queueName string, taskUUID string, state string, runResult string, sessionID string) (json.RawMessage, error) {
var payload = struct {
TaskUUID string `json:"task_uuid"`
State string `json:"state"`
RunResult string `json:"run_result"`
Hostname string `json:"host_name"`
SessionID string `json:"session_id"`
}{
TaskUUID: taskUUID,
State: state,
RunResult: runResult,
Hostname: c.Hostname,
SessionID: sessionID,
}

req, err := c.NewRequest("PUT", "/queues/"+queueName+".json", payload, nil)
Expand Down

0 comments on commit e514d76

Please sign in to comment.