Replace AddEventListener with AddEventListenerCtx and Publish with PublishCtx (#42284)

This commit is contained in:
idafurjes
2021-11-29 14:23:24 +01:00
committed by GitHub
parent 8927a3ca20
commit a65e0be110
6 changed files with 17 additions and 62 deletions
+1 -1
View File
@@ -206,7 +206,7 @@ func (hs *HTTPServer) CompleteInvite(c *models.ReqContext) response.Response {
return response.Error(500, "failed to create user", err)
}
if err := bus.Publish(&events.SignUpCompleted{
if err := bus.PublishCtx(c.Req.Context(), &events.SignUpCompleted{
Name: user.NameOrFallback(),
Email: user.Email,
}); err != nil {
+2 -2
View File
@@ -55,7 +55,7 @@ func SignUp(c *models.ReqContext) response.Response {
return response.Error(500, "Failed to create signup", err)
}
if err := bus.Publish(&events.SignUpStarted{
if err := bus.PublishCtx(c.Req.Context(), &events.SignUpStarted{
Email: form.Email,
Code: cmd.Code,
}); err != nil {
@@ -102,7 +102,7 @@ func (hs *HTTPServer) SignUpStep2(c *models.ReqContext) response.Response {
}
// publish signup event
if err := bus.Publish(&events.SignUpCompleted{
if err := bus.PublishCtx(c.Req.Context(), &events.SignUpCompleted{
Email: user.Email,
Name: user.NameOrFallback(),
}); err != nil {