MM-12849 Moving all non request scoped items to Server struct (#9806)

* Moving goroutine pool

* Auto refactor

* Moving plugins.

* Auto refactor

* Moving fields to server

* Auto refactor

* Removing siteurl duplication.

* Moving reset of app fields

* Auto refactor

* Formatting

* Moving niling of Server to after last use

* Fixing unit tests.
Этот коммит содержится в:
Christopher Speller
2018-11-07 10:20:07 -08:00
коммит произвёл GitHub
родитель 0dcbecac87
Коммит ecade2f1ec
52 изменённых файлов: 388 добавлений и 385 удалений

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

@@ -80,7 +80,7 @@ func (a *App) handleWebhookEvents(post *model.Post, team *model.Team, channel *m
TriggerWord: triggerWord,
FileIds: strings.Join(post.FileIds, ","),
}
a.Go(func(hook *model.OutgoingWebhook) func() {
a.Srv.Go(func(hook *model.OutgoingWebhook) func() {
return func() {
a.TriggerWebhook(payload, hook, post, channel)
}
@@ -102,7 +102,7 @@ func (a *App) TriggerWebhook(payload *model.OutgoingWebhookPayload, hook *model.
}
for _, url := range hook.CallbackURLs {
a.Go(func(url string) func() {
a.Srv.Go(func(url string) func() {
return func() {
req, _ := http.NewRequest("POST", url, body)
req.Header.Set("Content-Type", contentType)