mirror of
https://github.com/lukaszraczylo/go-simple-graphql.git
synced 2026-10-13 00:48:37 +00:00
15 lines
391 B
Go
15 lines
391 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("Cache hit", map[string]interface{}{"hash": hash})
|
|
return obj
|
|
}
|
|
// if error is not nil it means that hash is not present in cache
|
|
c.Logger.Debug("Cache miss", map[string]interface{}{"hash": hash})
|
|
}
|
|
return nil
|
|
}
|