"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
hubic: retry auth fetching if it fails to make hubic more reliable
Nick Craig-Wood164d1e05cafc
diff --git a/backend/hubic/auth.go b/backend/hubic/auth.goindex c437d31ce..08469acb6 100644--- a/backend/hubic/auth.go+++ b/backend/hubic/auth.go@@ -2,7 +2,9 @@ package hubicimport ("net/http"+ "time"+ "github.com/ncw/rclone/fs""github.com/ncw/swift")@@ -21,12 +23,17 @@ func newAuth(f *Fs) *auth {// Request constructs a http.Request for authentication//// returns nil for not needed-func (a *auth) Request(*swift.Connection) (*http.Request, error) {- err := a.f.getCredentials()- if err != nil {- return nil, err+func (a *auth) Request(*swift.Connection) (r *http.Request, err error) {+ const retries = 10+ for try := 1; try <= retries; try++ {+ err = a.f.getCredentials()+ if err == nil {+ break+ }+ time.Sleep(100 * time.Millisecond)+ fs.Debugf(a.f, "retrying auth request %d/%d: %v", try, retries, err)}- return nil, nil+ return nil, err}// Response parses the result of an http request