Commit 3a579732 authored by Jakub Sztandera's avatar Jakub Sztandera Committed by GitHub

Merge pull request #2 from ipfs-filestore/measure-fix

In the measure package don't return ErrInvalidType in batch Put.
parents 4171e3db 2353e253
......@@ -179,10 +179,9 @@ func (m *measure) Batch() (datastore.Batch, error) {
func (mt *measuredBatch) Put(key datastore.Key, val interface{}) error {
mt.puts++
valb, ok := val.([]byte)
if !ok {
return datastore.ErrInvalidType
if ok {
_ = mt.m.putSize.RecordValue(int64(len(valb)))
}
_ = mt.m.putSize.RecordValue(int64(len(valb)))
return mt.putts.Put(key, val)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment