From 15d64fb201848002a25facc3bbffc9535a704df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Wed, 26 Sep 2018 16:34:12 +0200 Subject: MM-7188: Cleaning push notification on every read, not only on channel switch (#9348) * MM-7188: Cleaning push notification on every read, not only on channel switch * Removed unnecesary goroutine * Fixing tests * Applying suggestion from PR --- app/app.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/app.go') diff --git a/app/app.go b/app/app.go index 511a464be..1c0d56a3c 100644 --- a/app/app.go +++ b/app/app.go @@ -50,6 +50,8 @@ type App struct { Hubs []*Hub HubsStopCheckingForDeadlock chan bool + PushNotificationsHub PushNotificationsHub + Jobs *jobs.JobServer AccountMigration einterfaces.AccountMigrationInterface @@ -128,6 +130,9 @@ func New(options ...Option) (outApp *App, outErr error) { app.HTTPService = MakeHTTPService(app) + app.CreatePushNotificationsHub() + app.StartPushNotificationsHubWorkers() + defer func() { if outErr != nil { app.Shutdown() @@ -276,6 +281,7 @@ func (a *App) Shutdown() { a.StopServer() a.HubStop() + a.StopPushNotificationsHubWorkers() a.ShutDownPlugins() a.WaitForGoroutines() -- cgit v1.2.3-1-g7c22