From f2193d53311cecde544ee4947608de94ed3e3716 Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Thu, 24 Aug 2023 13:15:52 -0400 Subject: 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 TryBot-Result: Gopher Robot Reviewed-by: Robert Findley kokoro-CI: kokoro --- internal/queue/gcpqueue/queue.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/queue/gcpqueue/queue.go') 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 -- cgit v1.3-5-g9baa