Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

onedrive: warn on gateway timeout errors

Nick Craig-Woodbedf6e90d2b1
diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go
index 3c21e4d6d..8f3f5e69d 100755
--- a/backend/onedrive/onedrive.go
+++ b/backend/onedrive/onedrive.go
@@ -427,6 +427,8 @@ var retryErrorCodes = []int{
509, // Bandwidth Limit Exceeded
}
+var gatewayTimeoutError sync.Once
+
// shouldRetry returns a boolean as to whether this resp and err
// deserve to be retried. It returns the err as a convenience
func shouldRetry(resp *http.Response, err error) (bool, error) {
@@ -451,6 +453,10 @@ func shouldRetry(resp *http.Response, err error) (bool, error) {
fs.Debugf(nil, "Too many requests. Trying again in %d seconds.", retryAfter)
}
}
+ case 504: // Gateway timeout
+ gatewayTimeoutError.Do(func() {
+ fs.Errorf(nil, "%v: upload chunks may be taking too long - try reducing --onedrive-chunk-size or decreasing --transfers", err)
+ })
case 507: // Insufficient Storage
return false, fserrors.FatalError(err)
}