Skip to content

Commit

Permalink
fix issue gogf#1755
Browse files Browse the repository at this point in the history
  • Loading branch information
qinyuguang778 authored and houseme committed Apr 18, 2022
1 parent 411f756 commit 66f978b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions database/gdb/gdb_model_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@ func (m *Model) getSelectResultFromCache(ctx context.Context, sql string, args .
if cacheItem, ok = v.Val().(*selectCacheItem); ok {
// In-memory cache.
return cacheItem.Result, nil
} else if err = json.UnmarshalUseNumber(v.Bytes(), &cacheItem); err != nil {
} else {
// Other cache, it needs conversion.
return nil, err
err = json.UnmarshalUseNumber(v.Bytes(), &cacheItem)
if err != nil {
return nil, err
}
return cacheItem.Result, nil
}
}
return
Expand Down

0 comments on commit 66f978b

Please sign in to comment.