summaryrefslogtreecommitdiffstats
path: root/app/app.go
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-09-26 16:34:12 +0200
committerGitHub <noreply@github.com>2018-09-26 16:34:12 +0200
commit15d64fb201848002a25facc3bbffc9535a704df6 (patch)
tree558282bb4126eef469525c3cb11ea3238919e6fa /app/app.go
parent37e00ef916af9a5aeae760a01fa0a0cf8ca93637 (diff)
downloadchat-15d64fb201848002a25facc3bbffc9535a704df6.tar.gz
chat-15d64fb201848002a25facc3bbffc9535a704df6.tar.bz2
chat-15d64fb201848002a25facc3bbffc9535a704df6.zip
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
Diffstat (limited to 'app/app.go')
-rw-r--r--app/app.go6
1 files changed, 6 insertions, 0 deletions
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()