GCS: allow a 10 seconds timeout for client creation

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2025-01-11 11:26:48 +01:00
parent 11055d49a3
commit d18e1ba3d9

View File

@@ -87,7 +87,9 @@ func NewGCSFs(connectionID, localTempDir, mountPath string, config GCSFsConfig)
if err = fs.config.validate(); err != nil { if err = fs.config.validate(); err != nil {
return fs, err return fs, err
} }
ctx := context.Background() ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
if fs.config.AutomaticCredentials > 0 { if fs.config.AutomaticCredentials > 0 {
fs.svc, err = storage.NewClient(ctx) fs.svc, err = storage.NewClient(ctx)
} else { } else {