fixup! Add missing retry mechanism. I have no idea how this was missed, but ho hum.

This commit is contained in:
2023-04-08 02:09:18 +01:00
parent d843238d46
commit 5a222aa316
+4 -5
View File
@@ -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
}