mirror of
https://github.com/lukaszraczylo/go-simple-graphql.git
synced 2026-10-12 00:45:31 +00:00
fixup! Add missing retry mechanism. I have no idea how this was missed, but ho hum.
This commit is contained in:
@@ -80,10 +80,13 @@ func (c *BaseClient) Query(queryContent string, queryVariables interface{}, quer
|
||||
if len(queryHeaders) > 0 {
|
||||
cacheBaseClient = reflect.ValueOf(*c).Interface().(BaseClient)
|
||||
queryHeaders = c.parseQueryHeaders(queryHeaders)
|
||||
defer func() {
|
||||
*c = cacheBaseClient
|
||||
}()
|
||||
}
|
||||
|
||||
if c.cache.enabled {
|
||||
queryHash = strutil.Md5(query.compiledQuery)
|
||||
queryHash = strutil.Md5(fmt.Sprintf("%s-%+v", query.compiledQuery, queryHeaders))
|
||||
c.Logger.Debug(c, "Hash calculated;", "hash:", queryHash)
|
||||
|
||||
cachedResponse = c.cacheLookup(queryHash)
|
||||
@@ -111,10 +114,6 @@ func (c *BaseClient) Query(queryContent string, queryVariables interface{}, quer
|
||||
c.cache.client.Set(queryHash, jsonData)
|
||||
}
|
||||
|
||||
if len(queryHeaders) > 0 {
|
||||
*c = cacheBaseClient
|
||||
}
|
||||
|
||||
return c.decodeResponse(jsonData), err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user