improve cache handlement for package gdb

This commit is contained in:
John Guo
2022-04-18 20:29:24 +08:00
parent a09c8497bc
commit e119f2a534

View File

@ -88,8 +88,7 @@ func (m *Model) getSelectResultFromCache(ctx context.Context, sql string, args .
return cacheItem.Result, nil
} else {
// Other cache, it needs conversion.
err = json.UnmarshalUseNumber(v.Bytes(), &cacheItem)
if err != nil {
if err = json.UnmarshalUseNumber(v.Bytes(), &cacheItem); err != nil {
return nil, err
}
return cacheItem.Result, nil