put blocks in cache after get
This commit is contained in:
parent
94555ea8c1
commit
bac1e3f901
@ -47,7 +47,13 @@ func (bs *CacheBS) Get(c cid.Cid) (block.Block, error) {
|
||||
return v.(block.Block), nil
|
||||
}
|
||||
|
||||
return bs.bs.Get(c)
|
||||
out, err := bs.bs.Get(c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
bs.cache.Add(c, out)
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (bs *CacheBS) GetSize(c cid.Cid) (int, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user