aboutsummaryrefslogtreecommitdiff
path: root/internal/queue/gcpqueue/queue.go
diff options
context:
space:
mode:
authorMichael Matloob <matloob@golang.org>2023-08-24 13:15:52 -0400
committerMichael Matloob <matloob@golang.org>2023-08-25 19:08:11 +0000
commitf2193d53311cecde544ee4947608de94ed3e3716 (patch)
treef600f2d458a7a7743d6ea87f2d49cedcbadebd9c /internal/queue/gcpqueue/queue.go
parent3841ba374e90486051d46d443d472b09710b601a (diff)
downloadgo-x-pkgsite-f2193d53311cecde544ee4947608de94ed3e3716.tar.xz
internal/config: separate config initialization into serverconfig
This change creates a new package that does config initialization and other GCP-specific operations that were previously done in package config, so that config can have no cloud dependencies. For golang/go#61399 Change-Id: I8d78294834e325b47d838892a1cef87003a4b90a Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/522516 Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'internal/queue/gcpqueue/queue.go')
-rw-r--r--internal/queue/gcpqueue/queue.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/queue/gcpqueue/queue.go b/internal/queue/gcpqueue/queue.go
index 23e4ec6a..bd568528 100644
--- a/internal/queue/gcpqueue/queue.go
+++ b/internal/queue/gcpqueue/queue.go
@@ -17,6 +17,7 @@ import (
"time"
"cloud.google.com/go/cloudtasks/apiv2"
+ "golang.org/x/pkgsite/internal/config/serverconfig"
taskspb "google.golang.org/genproto/googleapis/cloud/tasks/v2"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@@ -33,7 +34,7 @@ import (
// New creates a new Queue with name queueName based on the configuration
// in cfg. When running locally, Queue uses numWorkers concurrent workers.
func New(ctx context.Context, cfg *config.Config, queueName string, numWorkers int, expGetter middleware.ExperimentGetter, processFunc queue.InMemoryProcessFunc) (queue.Queue, error) {
- if !cfg.OnGCP() {
+ if !serverconfig.OnGCP() {
experiments, err := expGetter(ctx)
if err != nil {
return nil, err