mirror of
https://github.com/lukaszraczylo/go-simple-graphql.git
synced 2026-10-13 00:48:37 +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
-4
@@ -74,6 +74,7 @@ func (q *queryExecutor) execute() {
|
||||
if cachedResponse != nil {
|
||||
q.client.Logger.Debug(q.client, "Found cached response")
|
||||
q.result.data = q.client.decodeResponse(cachedResponse)
|
||||
return // return cached response
|
||||
} else {
|
||||
q.client.Logger.Debug(q.client, "No cached response found")
|
||||
}
|
||||
@@ -94,10 +95,7 @@ func (q *queryExecutor) execute() {
|
||||
}
|
||||
|
||||
if q.should_cache {
|
||||
err = q.client.cache.client.Set(q.hash, jsonData)
|
||||
if err != nil {
|
||||
q.client.Logger.Error(q.client, "Error while setting cache key;", "error", err.Error())
|
||||
}
|
||||
q.client.cache.client.Set(q.hash, jsonData, time.Duration(q.client.cache.ttl)*time.Second)
|
||||
}
|
||||
|
||||
q.result.data = q.client.decodeResponse(jsonData)
|
||||
|
||||
Reference in New Issue
Block a user