* goroutine wranglin

* synchronize WebConn.WritePump
Этот коммит содержится в:
Chris
2017-10-03 10:53:53 -05:00
коммит произвёл GitHub
родитель bfe7955fb0
Коммит 5e69ce099f
26 изменённых файлов: 233 добавлений и 118 удалений

Просмотреть файл

@@ -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)
}
}