From 43c6bc7abc2e2d6da433af8fff5082361828d34b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 26 Aug 2024 13:43:43 +0200 Subject: [PATCH] worker: simplify the `POST` in workerHeartbeat() 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. --- internal/worker/client.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/worker/client.go b/internal/worker/client.go index 04cde6313..6da714d96 100644 --- a/internal/worker/client.go +++ b/internal/worker/client.go @@ -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