Skip to content

Commit 60ec192

Browse files
committed
fix chunkkeys location
1 parent 0817859 commit 60ec192

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/storage.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ func (cas *ContentAddressableStorage) Add(ctx context.Context, hash string, cont
9494
// Copy the chunk into a new buffer
9595
chunk := make([]byte, end-offset)
9696
copy(chunk, content[offset:end])
97+
9798
chunkKey := fmt.Sprintf("%s-%d", hash, chunkIdx)
99+
chunkKeys = append(chunkKeys, chunkKey)
98100

99101
_, exists := cas.cache.GetTTL(chunkKey)
100102
if exists {
@@ -107,7 +109,6 @@ func (cas *ContentAddressableStorage) Add(ctx context.Context, hash string, cont
107109
return errors.New("unable to cache: set dropped")
108110
}
109111

110-
chunkKeys = append(chunkKeys, chunkKey)
111112
}
112113

113114
// Release the large initial buffer

0 commit comments

Comments
 (0)