diff options
| author | Taras Madan <tarasmadan@google.com> | 2024-08-12 15:48:55 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2024-08-12 15:10:06 +0000 |
| commit | 2235b7c2d4bfb5d187135362cf1f3f0e708972df (patch) | |
| tree | df2478382a5a6fc75e6050d3885bb21736b9e48e /pkg | |
| parent | 6ba02fb7c5dd2e8985ade7303b33c940d4d1d6a9 (diff) | |
all: pkg/gcs supports AppEngine context
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/asset/backend_gcs.go | 3 | ||||
| -rw-r--r-- | pkg/gcs/gcs.go | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pkg/asset/backend_gcs.go b/pkg/asset/backend_gcs.go index a196d89b9..7791fe777 100644 --- a/pkg/asset/backend_gcs.go +++ b/pkg/asset/backend_gcs.go @@ -4,6 +4,7 @@ package asset import ( + "context" "fmt" "io" "net/url" @@ -22,7 +23,7 @@ type cloudStorageBackend struct { func makeCloudStorageBackend(bucket string, tracer debugtracer.DebugTracer) (*cloudStorageBackend, error) { tracer.Log("created gcs backend for bucket '%s'", bucket) - client, err := gcs.NewClient() + client, err := gcs.NewClient(context.Background()) if err != nil { return nil, fmt.Errorf("the call to NewClient failed: %w", err) } diff --git a/pkg/gcs/gcs.go b/pkg/gcs/gcs.go index e46350d2c..756d2c65d 100644 --- a/pkg/gcs/gcs.go +++ b/pkg/gcs/gcs.go @@ -38,8 +38,7 @@ func (file *File) Reader() (io.ReadCloser, error) { return file.handle.NewReader(file.ctx) } -func NewClient() (*Client, error) { - ctx := context.Background() +func NewClient(ctx context.Context) (*Client, error) { storageClient, err := storage.NewClient(ctx) if err != nil { return nil, err |
