mirror of
https://github.com/lukaszraczylo/go-simple-graphql.git
synced 2026-10-14 00:58:32 +00:00
Replace allegro/bigcache with something lighter.
In high frequency environment the allegro bigcache caused significant memory usage overhead. This commit replaces it with something much lighter.
This commit is contained in:
@@ -2,10 +2,10 @@ package gql
|
||||
|
||||
func (c *BaseClient) cacheLookup(hash string) []byte {
|
||||
if c.cache.client != nil {
|
||||
g, err := c.cache.client.Get(hash)
|
||||
if err == nil {
|
||||
obj, found := c.cache.client.Get(hash)
|
||||
if found {
|
||||
c.Logger.Debug(c, "Cache hit;", "hash", hash)
|
||||
return g
|
||||
return obj.([]byte)
|
||||
}
|
||||
// if error is not nil it means that hash is not present in cache
|
||||
c.Logger.Debug(c, "Cache miss;", "hash", hash)
|
||||
|
||||
Reference in New Issue
Block a user