From b2e99350492962df182dd695ff1896aae6dd824f Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sat, 11 Jan 2025 11:24:35 +0100 Subject: [PATCH] GCS: allow a 10 seconds timeout for client creation Signed-off-by: Nicola Murino --- internal/vfs/gcsfs.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/vfs/gcsfs.go b/internal/vfs/gcsfs.go index eb691624..a1b15f97 100644 --- a/internal/vfs/gcsfs.go +++ b/internal/vfs/gcsfs.go @@ -86,7 +86,9 @@ func NewGCSFs(connectionID, localTempDir, mountPath string, config GCSFsConfig) if err = fs.config.validate(); err != nil { return fs, err } - ctx := context.Background() + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + if fs.config.AutomaticCredentials > 0 { fs.svc, err = storage.NewClient(ctx, storage.WithJSONReads(),