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

b2: fix upload url not being refreshed properly #825

Nick Craig-Wooda4bf22e620b7
diff --git a/b2/b2.go b/b2/b2.go
index 8a663a590..280a34958 100644
--- a/b2/b2.go
+++ b/b2/b2.go
@@ -1280,7 +1280,10 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo) (err error) {
if err != nil {
return err
}
- defer o.fs.returnUploadURL(upload)
+ defer func() {
+ // return it like this because we might nil it out
+ o.fs.returnUploadURL(upload)
+ }()
// Headers for upload file
//