From a0fe5014a9adcf27de2dc90bc11bdd96098403ea Mon Sep 17 00:00:00 2001 From: emmyni <44761757+emmyni@users.noreply.github.com> Date: Thu, 8 Dec 2022 17:07:34 -0500 Subject: [PATCH] [MM-48649]: Call the SendSubscriptionHistoryEvent function in a GO routine (#21836) --- app/user.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/user.go b/app/user.go index a2f72eddb5..6e12bda34b 100644 --- a/app/user.go +++ b/app/user.go @@ -316,10 +316,13 @@ func (a *App) createUserOrGuest(c request.CTX, user *model.User, guest bool) (*m }, plugin.UserHasBeenCreatedID) }) - _, cwsErr := a.SendSubscriptionHistoryEvent(ruser.Id) - if cwsErr != nil { - c.Logger().Error("Failed to create/update the SubscriptionHistoryEvent", mlog.Err(cwsErr)) - } + // Create/Update the subscriptionHistoryEvent + go func() { + _, err := a.SendSubscriptionHistoryEvent(ruser.Id) + if err != nil { + c.Logger().Error("Failed to create/update the SubscriptionHistoryEvent", mlog.Err(err)) + } + }() return ruser, nil }