Skip to content

Commit

Permalink
Merge pull request #2 from ipfs-filestore/measure-fix
Browse files Browse the repository at this point in the history
In the measure package don't return ErrInvalidType in batch Put.
  • Loading branch information
Kubuxu authored Jun 11, 2016
2 parents 4171e3d + 2353e25 commit 3a57973
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions measure/measure.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 3a57973

Please sign in to comment.