Cloud Storage 的 go 客戶端的一些 Google文檔說:該庫支持向 Cloud Storage 讀取和寫入大量數(shù)據(jù),具有內(nèi)部錯誤處理和重試功能,因此您無需編寫自己的代碼來執(zhí)行此操作。但是,當(dāng)使用以下將對象放入云存儲的代碼片段時,有時會向我返回 503 Service Unavailable 錯誤。重試 Cloud Storage 請求的邏輯在哪里? conf, err := google.JWTConfigFromJSON([]byte(apiKey),storage.ScopeFullControl) if err != nil { panic(err) } ctx := cloud.NewContext(projectId, conf.Client(oauth2.NoContext)) writer := storage.NewWriter(self.ctx, Bucket, key) _, err := writer.Write(data) if err != nil { return err }
- 1 回答
- 0 關(guān)注
- 218 瀏覽
添加回答
舉報
0/150
提交
取消