Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jan 11, 2024
2 parents 84c4d73 + e771fe7 commit 9a37cfd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kernel/api/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package api

import (
"net/http"
"strings"

"github.com/88250/gulu"
"github.com/gin-gonic/gin"
Expand All @@ -33,7 +34,13 @@ func pushMsg(c *gin.Context) {
return
}

msg := arg["msg"].(string)
msg := strings.TrimSpace(arg["msg"].(string))
if "" == msg {
ret.Code = -1
ret.Msg = "msg can't be empty"
return
}

timeout := 7000
if nil != arg["timeout"] {
timeout = int(arg["timeout"].(float64))
Expand Down
5 changes: 5 additions & 0 deletions kernel/server/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,11 @@ func serveRepoDiff(ginServer *gin.Engine) {
}

func serveDebug(ginServer *gin.Engine) {
if "prod" == util.Mode {
// The production environment will no longer register `/debug/pprof/` https://github.com/siyuan-note/siyuan/issues/10152
return
}

ginServer.GET("/debug/pprof/", gin.WrapF(pprof.Index))
ginServer.GET("/debug/pprof/allocs", gin.WrapF(pprof.Index))
ginServer.GET("/debug/pprof/block", gin.WrapF(pprof.Index))
Expand Down

0 comments on commit 9a37cfd

Please sign in to comment.