Merge pull request #16381 from ioito/hotfix/qx-webconsole-stats

fix(webconsole): avoid panic when send stats request
This commit is contained in:
Zexi Li
2023-04-07 18:20:03 +08:00
committed by GitHub
+3 -3
View File
@@ -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)
}
}