Improve API4 initialization (#18680)
* Improve API4 initialization - Refactored openGraphDataCache to be inside app layer. - Moved the cache instance from global variable to be inside server. - Moved out the app instantiation from the global commands package to be instantiated on every call. Only the server instance is passed. - Moved InitLocal to be called from inside Init. ```release-note NONE ``` * Remove commented line ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
43a99a5783
Коммит
c27814393d
@@ -18,16 +18,16 @@ import (
|
||||
)
|
||||
|
||||
type Web struct {
|
||||
app app.AppIface
|
||||
srv *app.Server
|
||||
MainRouter *mux.Router
|
||||
}
|
||||
|
||||
func New(a app.AppIface, root *mux.Router) *Web {
|
||||
func New(srv *app.Server) *Web {
|
||||
mlog.Debug("Initializing web routes")
|
||||
|
||||
web := &Web{
|
||||
app: a,
|
||||
MainRouter: root,
|
||||
srv: srv,
|
||||
MainRouter: srv.Router,
|
||||
}
|
||||
|
||||
web.InitOAuth()
|
||||
|
||||
Ссылка в новой задаче
Block a user