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

@ -6,7 +6,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"
@ -57,7 +56,10 @@ func (m *Module) send(call goja.FunctionCall, rt *goja.Runtime) goja.Value {
sessionID, ok := firstArg.Export().(string)
if !ok {
ctx := util.AssertContext(firstArg, rt)
sessionID = module.ContextValue[string](ctx, edgehttp.ContextKeySessionID)
sessionID, ok = edgehttp.ContextSessionID(ctx)
if !ok {
panic(rt.ToValue(errors.New("could not find session id in context")))
}
}
data := call.Argument(1).Export()