fix(module,net): add missing context to server message

fix #6
This commit is contained in:
wpetit 2023-03-03 10:43:09 +01:00
parent f1dd467c95
commit b61bf52df9
1 changed files with 3 additions and 2 deletions

View File

@ -38,9 +38,10 @@ func (m *Module) broadcast(call goja.FunctionCall, rt *goja.Runtime) goja.Value
}
data := call.Argument(0).Export()
ctx := context.Background()
msg := module.NewServerMessage(nil, data)
if err := m.bus.Publish(context.Background(), msg); err != nil {
msg := module.NewServerMessage(ctx, data)
if err := m.bus.Publish(ctx, msg); err != nil {
panic(rt.ToValue(errors.WithStack(err)))
}