Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2020-07-20 10:10:14 +0300
committerJaime Martinez <jmartinez@gitlab.com>2020-07-24 07:49:29 +0300
commitf5e00b5cebd6b6a193c802b03a3b9ec772eff31d (patch)
treefc2cc8e27580c082a19dc12716758fcd2c6bb13f /internal/source/gitlab/client/client.go
parent06ccc84529b9e9ee0bd0259b93f3647ad5ef3b03 (diff)
Move polling out of the client
Let the `package gitlab` handle the polling instead of the client.
Diffstat (limited to 'internal/source/gitlab/client/client.go')
-rw-r--r--internal/source/gitlab/client/client.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/source/gitlab/client/client.go b/internal/source/gitlab/client/client.go
index 1d4cde9f..e06a87d1 100644
--- a/internal/source/gitlab/client/client.go
+++ b/internal/source/gitlab/client/client.go
@@ -109,13 +109,15 @@ func (gc *Client) GetLookup(ctx context.Context, host string) api.Lookup {
// for source domain configuration.
// Timeout is the same as -gitlab-client-http-timeout
func (gc *Client) Status() error {
- // nolint: bodyclose
- // this endpoint returns a http.StatusNoContent response
- _, err := gc.get(context.Background(), "/api/v4/internal/pages/status", url.Values{})
+ res, err := gc.get(context.Background(), "/api/v4/internal/pages/status", url.Values{})
if err != nil {
return fmt.Errorf("%s: %v", ConnectionErrorMsg, err)
}
+ if res != nil && res.Body != nil {
+ res.Body.Close()
+ }
+
return nil
}