Skip to content

Commit

Permalink
Avoid any leak of the digest proto
Browse files Browse the repository at this point in the history
  • Loading branch information
Garbett1 committed Oct 29, 2023
1 parent 742a8a9 commit d88d714
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mettle/worker/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ func (r *redisClient) ReadBlob(dg *pb.Digest) ([]byte, error) {
return nil, err
}
if dg.SizeBytes < r.maxSize {
go func() {
go func(hash string) {
ctx, cancel = context.WithTimeout(context.Background(), r.timeout)
defer cancel()
if cmd := r.redis.Set(ctx, dg.Hash, blob, 0); cmd.Val() != "OK" {
if cmd := r.redis.Set(ctx, hash, blob, 0); cmd.Val() != "OK" {
log.Warning("Failed to set blob in Redis: %s", cmd.Err())
}
}()
}(dg.Hash)
}
return blob, nil
}
Expand Down

0 comments on commit d88d714

Please sign in to comment.