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 удалений

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

@@ -19,7 +19,7 @@ import (
)
func (a *App) ServePluginRequest(w http.ResponseWriter, r *http.Request) {
if a.Plugins == nil || !*a.Config().PluginSettings.Enable {
if a.Srv.Plugins == nil || !*a.Config().PluginSettings.Enable {
err := model.NewAppError("ServePluginRequest", "app.plugin.disabled.app_error", nil, "Enable plugins to serve plugin requests", http.StatusNotImplemented)
a.Log.Error(err.Error())
w.WriteHeader(err.StatusCode)
@@ -29,7 +29,7 @@ func (a *App) ServePluginRequest(w http.ResponseWriter, r *http.Request) {
}
params := mux.Vars(r)
hooks, err := a.Plugins.HooksForPlugin(params["plugin_id"])
hooks, err := a.Srv.Plugins.HooksForPlugin(params["plugin_id"])
if err != nil {
a.Log.Error("Access to route for non-existent plugin", mlog.String("missing_plugin_id", params["plugin_id"]), mlog.Err(err))
http.NotFound(w, r)