mirror of
https://github.com/rclone/rclone.git
synced 2025-02-18 11:31:19 +01:00
local: make Hash function cancelable via context
This commit is contained in:
parent
e7483b40b3
commit
5e4caa69ce
@ -903,7 +903,7 @@ func (o *Object) Hash(ctx context.Context, r hash.Type) (string, error) {
|
|||||||
return "", fmt.Errorf("hash: failed to open: %w", err)
|
return "", fmt.Errorf("hash: failed to open: %w", err)
|
||||||
}
|
}
|
||||||
var hashes map[hash.Type]string
|
var hashes map[hash.Type]string
|
||||||
hashes, err = hash.StreamTypes(in, hash.NewHashSet(r))
|
hashes, err = hash.StreamTypes(readers.NewContextReader(ctx, in), hash.NewHashSet(r))
|
||||||
closeErr := in.Close()
|
closeErr := in.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("hash: failed to read: %w", err)
|
return "", fmt.Errorf("hash: failed to read: %w", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user