From d18e1ba3d99fb6d76ce46888467fc08e70939880 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sat, 11 Jan 2025 11:26:48 +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 613e67ff..8cce459e 100644 --- a/internal/vfs/gcsfs.go +++ b/internal/vfs/gcsfs.go @@ -87,7 +87,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) } else {