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-08-06 04:23:49 +0300
committerJaime Martinez <jmartinez@gitlab.com>2020-08-06 04:23:49 +0300
commitf1b46f98d343dc5b12928aaa79c39f0c7db8e3af (patch)
tree53210f593dcf59f9975b4f48a8738e9ecb14de74 /internal/source/gitlab
parentb2922c74ae775f4a56c784572c6672fa2c7332fa (diff)
Revert "Merge branch 'revert-b3bf3ac4' into 'master'"revert-84c3866
This reverts commit 84c3866ba69e2ca0ca7d512b09ae66458f5c1c5c, reversing changes made to 185e0a0e5c621f350335495291c535e5c05df89b.
Diffstat (limited to 'internal/source/gitlab')
-rw-r--r--internal/source/gitlab/gitlab.go8
-rw-r--r--internal/source/gitlab/gitlab_poll.go1
2 files changed, 9 insertions, 0 deletions
diff --git a/internal/source/gitlab/gitlab.go b/internal/source/gitlab/gitlab.go
index 5bacb603..2635d864 100644
--- a/internal/source/gitlab/gitlab.go
+++ b/internal/source/gitlab/gitlab.go
@@ -104,3 +104,11 @@ func (g *Gitlab) Resolve(r *http.Request) (*serving.Request, error) {
return &serving.Request{Serving: defaultServing()},
errors.New("could not match lookup path")
}
+
+// IsReady returns the value of Gitlab `isReady` which is updated by `Poll`.
+func (g *Gitlab) IsReady() bool {
+ g.mu.RLock()
+ defer g.mu.RUnlock()
+
+ return g.isReady
+}
diff --git a/internal/source/gitlab/gitlab_poll.go b/internal/source/gitlab/gitlab_poll.go
index 70644822..9fce7250 100644
--- a/internal/source/gitlab/gitlab_poll.go
+++ b/internal/source/gitlab/gitlab_poll.go
@@ -15,6 +15,7 @@ const (
// poll tries to call the /internal/pages/status API endpoint once plus
// `retries` every `interval`.
+// It updates the `isReady` value when successful.
// TODO: Remove in https://gitlab.com/gitlab-org/gitlab/-/issues/218357
func (g *Gitlab) poll(retries int, interval time.Duration) {
var err error