From 5e4caa69cefbbaa7e0f8549efc78e44728374289 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 9 Nov 2021 09:45:10 +0000 Subject: [PATCH] local: make Hash function cancelable via context --- backend/local/local.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/local/local.go b/backend/local/local.go index 3c00d5389..e36c56e2c 100644 --- a/backend/local/local.go +++ b/backend/local/local.go @@ -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) } 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() if err != nil { return "", fmt.Errorf("hash: failed to read: %w", err)