From 5e69ce099f521aa49fc267c62235c003eae530ff Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 3 Oct 2017 10:53:53 -0500 Subject: Goroutine wranglin (#7556) * goroutine wranglin * synchronize WebConn.WritePump --- app/email_batching.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/email_batching.go') diff --git a/app/email_batching.go b/app/email_batching.go index b9f89d646..4c546531f 100644 --- a/app/email_batching.go +++ b/app/email_batching.go @@ -175,7 +175,11 @@ func (job *EmailBatchingJob) checkPendingNotifications(now time.Time, handler fu // send the email notification if it's been long enough if now.Sub(time.Unix(batchStartTime/1000, 0)) > time.Duration(interval)*time.Second { - go handler(userId, notifications) + job.app.Go(func(userId string, notifications []*batchedNotification) func() { + return func() { + handler(userId, notifications) + } + }(userId, notifications)) delete(job.pendingNotifications, userId) } } -- cgit v1.2.3-1-g7c22