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

sync: free objects after they come out of the transfer pipe

Nick Craig-Wood543100070a2c
diff --git a/fs/sync/pipe.go b/fs/sync/pipe.go
index 0caf3f77a..1af0e684a 100644
--- a/fs/sync/pipe.go
+++ b/fs/sync/pipe.go
@@ -68,7 +68,10 @@ func (p *pipe) Get(ctx context.Context) (pair fs.ObjectPair, ok bool) {
}
}
p.mu.Lock()
- pair, p.queue = p.queue[0], p.queue[1:]
+ pair = p.queue[0]
+ p.queue[0].Src = nil
+ p.queue[0].Dst = nil
+ p.queue = p.queue[1:]
size := pair.Src.Size()
if size > 0 {
p.totalSize -= size