Removed (*App).Shutdown and updated all references. (#15088)

Этот коммит содержится в:
Doug Lauder
2020-07-22 13:30:11 -04:00
коммит произвёл GitHub
родитель 6b5c0bb5d2
Коммит b372b98aca
23 изменённых файлов: 87 добавлений и 114 удалений

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

@@ -117,14 +117,6 @@ func (a *App) InitServer() {
a.saml = a.srv.Saml
}
// DO NOT CALL THIS.
// This is to avoid having to change all the code in cmd/mattermost/commands/* for now
// shutdown should be called directly on the server
func (a *App) Shutdown() {
a.Srv().Shutdown()
a.srv = nil
}
func (a *App) initJobs() {
if jobsLdapSyncInterface != nil {
a.srv.Jobs.LdapSync = jobsLdapSyncInterface(a)

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

@@ -83,10 +83,6 @@ type AppIface interface {
CreateUser(user *model.User) (*model.User, *model.AppError)
// Creates and stores FileInfos for a post created before the FileInfos table existed.
MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo
// DO NOT CALL THIS.
// This is to avoid having to change all the code in cmd/mattermost/commands/* for now
// shutdown should be called directly on the server
Shutdown()
// DefaultChannelNames returns the list of system-wide default channel names.
//
// By default the list will be (not necessarily in this order):

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

@@ -24,7 +24,7 @@ func TestAppRace(t *testing.T) {
a.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.ListenAddress = ":0" })
serverErr := a.StartServer()
require.NoError(t, serverErr)
a.Shutdown()
a.Srv().Shutdown()
}
}
*/

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

@@ -13330,21 +13330,6 @@ func (a *OpenTracingAppLayer) SetTeamIconFromMultiPartFile(teamId string, file m
return resultVar0
}
func (a *OpenTracingAppLayer) Shutdown() {
origCtx := a.ctx
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Shutdown")
a.ctx = newCtx
a.app.Srv().Store.SetContext(newCtx)
defer func() {
a.app.Srv().Store.SetContext(origCtx)
a.ctx = origCtx
}()
defer span.Finish()
a.app.Shutdown()
}
func (a *OpenTracingAppLayer) SlackAddBotUser(teamId string, log *bytes.Buffer) *model.User {
origCtx := a.ctx
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SlackAddBotUser")