mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #16381 from ioito/hotfix/qx-webconsole-stats
fix(webconsole): avoid panic when send stats request
This commit is contained in:
@@ -111,7 +111,7 @@ func start() {
|
||||
root.Handle(webconsole.WebsocketProxyPathPrefix, srv)
|
||||
|
||||
// misc handler
|
||||
addMiscHandlers(root)
|
||||
addMiscHandlers(app, root)
|
||||
|
||||
cron := cronman.InitCronJobManager(true, o.Options.CronJobWorkerCount)
|
||||
|
||||
@@ -138,10 +138,10 @@ func start() {
|
||||
}
|
||||
}
|
||||
|
||||
func addMiscHandlers(root *mux.Router) {
|
||||
func addMiscHandlers(app *appsrv.Application, root *mux.Router) {
|
||||
adapterF := func(appHandleFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request)) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
appHandleFunc(context.TODO(), w, r)
|
||||
appHandleFunc(app.GetContext(), w, r)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user