mirror of
https://github.com/openfaas/faas.git
synced 2025-06-30 02:33:29 +00:00
Return cached query when hit
The code was calling into the cache twice, even if the first call was a cache hit and not a miss. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
@ -42,6 +42,8 @@ func (c *CachedFunctionQuery) Get(fn string, ns string) (ServiceQueryResponse, e
|
||||
return ServiceQueryResponse{}, err
|
||||
}
|
||||
c.cache.Set(fn, ns, queryResponse)
|
||||
} else {
|
||||
return query, nil
|
||||
}
|
||||
|
||||
// At this point the value almost certainly must be present, so if not
|
||||
|
Reference in New Issue
Block a user