rcat: fix slowdown on systems with multiple hashes
Before this fix rclone calculated all the hashes on transfer. This was particularly slow for the local backend. After the fix we just calculate one hash which is enough for data integrity.
This commit is contained in:
parent
62b769a0a7
commit
c014b2e66b
1 changed files with 3 additions and 2 deletions
|
@ -1222,8 +1222,9 @@ func Rcat(ctx context.Context, fdst fs.Fs, dstFileName string, in io.ReadCloser,
|
||||||
}()
|
}()
|
||||||
in = tr.Account(in).WithBuffer()
|
in = tr.Account(in).WithBuffer()
|
||||||
|
|
||||||
hashOption := &fs.HashesOption{Hashes: fdst.Hashes()}
|
hashes := hash.NewHashSet(fdst.Hashes().GetOne()) // just pick one hash
|
||||||
hash, err := hash.NewMultiHasherTypes(fdst.Hashes())
|
hashOption := &fs.HashesOption{Hashes: hashes}
|
||||||
|
hash, err := hash.NewMultiHasherTypes(hashes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue