mirror of
https://github.com/rclone/rclone.git
synced 2025-12-12 06:24:14 +01:00
operations: make Open() return an io.ReadSeekCloser #7350
As part of reducing memory usage in rclone, we need to have a raw handle to an object we can seek with.
This commit is contained in:
@@ -335,7 +335,8 @@ func CheckIdenticalDownload(ctx context.Context, dst, src fs.Object) (differ boo
|
||||
|
||||
// Does the work for CheckIdenticalDownload
|
||||
func checkIdenticalDownload(ctx context.Context, dst, src fs.Object) (differ bool, err error) {
|
||||
in1, err := Open(ctx, dst)
|
||||
var in1, in2 io.ReadCloser
|
||||
in1, err = Open(ctx, dst)
|
||||
if err != nil {
|
||||
return true, fmt.Errorf("failed to open %q: %w", dst, err)
|
||||
}
|
||||
@@ -345,7 +346,7 @@ func checkIdenticalDownload(ctx context.Context, dst, src fs.Object) (differ boo
|
||||
}()
|
||||
in1 = tr1.Account(ctx, in1).WithBuffer() // account and buffer the transfer
|
||||
|
||||
in2, err := Open(ctx, src)
|
||||
in2, err = Open(ctx, src)
|
||||
if err != nil {
|
||||
return true, fmt.Errorf("failed to open %q: %w", src, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user