Skip to content

Commit

Permalink
worker: simplify the POST in workerHeartbeat()
Browse files Browse the repository at this point in the history
There is no actual payload when posting the worker status so let's
just post `nil` instead of an empty `bytes.Buffer` to make this
explicit.
  • Loading branch information
mvo5 committed Aug 26, 2024
1 parent 802fbce commit 43c6bc7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/worker/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,7 @@ func (c *Client) workerHeartbeat() {
continue
}

var buf bytes.Buffer
resp, err := c.NewRequest("POST", url.String(), map[string]string{"Content-Type": "application/json"}, bytes.NewReader(buf.Bytes()))
resp, err := c.NewRequest("POST", url.String(), map[string]string{"Content-Type": "application/json"}, nil)
if err != nil {
logrus.Errorf("Error updating worker status: %v", err)
continue
Expand Down

0 comments on commit 43c6bc7

Please sign in to comment.