feat(storage): improve caching in cache driver
All checks were successful
arcad/edge/pipeline/head This commit looks good

ref #20
This commit is contained in:
2023-11-30 19:09:51 +01:00
parent 870db072e0
commit 32f04af138
16 changed files with 312 additions and 103 deletions

View File

@ -7,7 +7,6 @@ import (
"forge.cadoles.com/arcad/edge/pkg/app"
"forge.cadoles.com/arcad/edge/pkg/bus"
edgehttp "forge.cadoles.com/arcad/edge/pkg/http"
"forge.cadoles.com/arcad/edge/pkg/module"
"forge.cadoles.com/arcad/edge/pkg/module/util"
"github.com/dop251/goja"
"github.com/pkg/errors"
@ -143,10 +142,15 @@ func (m *Module) handleIncomingHTTPMessages(ctx context.Context, incoming <-chan
continue
}
requestCtx := logger.With(msg.Context, logger.F("rpcRequestMethod", jsonReq.Method), logger.F("rpcRequestID", jsonReq.ID))
sessionID, ok := edgehttp.ContextSessionID(msg.Context)
if !ok {
logger.Error(ctx, "could not find session id in context")
continue
}
request := NewRequestEnvelope(msg.Context, jsonReq.Method, jsonReq.Params)
sessionID := module.ContextValue[string](msg.Context, edgehttp.ContextKeySessionID)
requestCtx := logger.With(msg.Context, logger.F("rpcRequestMethod", jsonReq.Method), logger.F("rpcRequestID", jsonReq.ID))
reply, err := m.bus.Request(requestCtx, request)
if err != nil {