File size: 631 Bytes
13555f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package app

import (
	"context"

	"github.com/mattermost/mattermost/server/public/shared/mlog"
)

// initialize is called when the App is first created.
func (a *App) initialize(skipTemplateInit bool) {
	if !skipTemplateInit {
		if err := a.InitTemplates(); err != nil {
			a.logger.Error(`InitializeTemplates failed`, mlog.Err(err))
		}
	}
}

func (a *App) Shutdown() {
	if a.blockChangeNotifier != nil {
		ctx, cancel := context.WithTimeout(context.Background(), blockChangeNotifierShutdownTimeout)
		defer cancel()
		if !a.blockChangeNotifier.Shutdown(ctx) {
			a.logger.Warn("blockChangeNotifier shutdown timed out")
		}
	}
}