Files
go-simple-graphql/cache.go
T
lukaszraczylo 7d3abf5464 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.
2023-04-08 21:36:11 +01:00

15 lines
360 B
Go

package gql
func (c *BaseClient) cacheLookup(hash string) []byte {
if c.cache.client != nil {
obj, found := c.cache.client.Get(hash)
if found {
c.Logger.Debug(c, "Cache hit;", "hash", hash)
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)
}
return nil
}