diff --git a/app/query/cache.go b/app/query/cache.go index 2e603a05..e7060623 100644 --- a/app/query/cache.go +++ b/app/query/cache.go @@ -84,10 +84,10 @@ func NewCacheRequest(method string, params any, metaKey string) CacheRequest { } } -func (c *QueryCache) Retrieve(query *Query, metaKey string, getter func() (any, error)) (*CachedResponse, error) { +func (c *QueryCache) Retrieve(query *Query, getter func() (any, error)) (*CachedResponse, error) { log := logger.Log() - cacheReq := NewCacheRequest(query.Method(), query.Params(), metaKey) + cacheReq := NewCacheRequest(query.Method(), query.Params(), "") ctx, cancel := context.WithTimeout(context.Background(), 5000*time.Millisecond) defer cancel() diff --git a/app/query/processors.go b/app/query/processors.go index 9adafc2f..550ce60f 100644 --- a/app/query/processors.go +++ b/app/query/processors.go @@ -663,8 +663,8 @@ func preflightCacheHook(caller *Caller, ctx context.Context) (*jsonrpc.RPCRespon case err == nil && resp.Error == nil: if attempt > 0 { log.Infof( - "cache retriever %s attempt #%d succeeded (after spending %.2f seconds)", - query.Method(), attempt, time.Since(totalStart).Seconds(), + "cache retriever %s attempt #%d succeeded (after spending %.2f seconds) for %d@%s", + query.Method(), attempt, time.Since(totalStart).Seconds(), caller.userID, caller.Endpoint(), ) QueryCacheRetrySuccesses.Observe(float64(attempt)) } @@ -672,22 +672,21 @@ func preflightCacheHook(caller *Caller, ctx context.Context) (*jsonrpc.RPCRespon case err != nil: QueryCacheRetrievalFailures.WithLabelValues(CacheRetrievalErrorNet, query.Method()).Inc() log.Infof( - "cache retriever %s attempt #%d failed after %.3fs, err=%+v @ %s", - query.Method(), attempt, duration, err, caller.Endpoint(), + "cache retriever %s attempt #%d failed after %.3fs, err=%+v for %d@%s", + query.Method(), attempt, duration, err, caller.userID, caller.Endpoint(), ) case resp.Error != nil: QueryCacheRetrievalFailures.WithLabelValues(CacheRetrievalErrorSdk, query.Method()).Inc() log.Infof( - "cache retriever %s attempt #%d failed after %.3fs, resp=%+v @ %s", - query.Method(), attempt, duration, resp.Error, caller.Endpoint(), + "cache retriever %s attempt #%d failed after %.3fs, resp=%+v @ %d@%s", + query.Method(), attempt, duration, resp.Error, caller.userID, caller.Endpoint(), ) } } return resp, err } - metaKey := fmt.Sprintf("%d@%s", caller.userID, caller.Endpoint()) - cachedResp, err := caller.Cache.Retrieve(query, metaKey, getter) + cachedResp, err := caller.Cache.Retrieve(query, getter) if err != nil { return nil, rpcerrors.NewSDKError(err) }