Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Concurrency control when requesting the kernel API https://github.com/siyuan-note/siyuan/issues/9939

Daniela190066523f8
diff --git a/kernel/model/session.go b/kernel/model/session.go
index 75ca732d65..d25950debb 100644
--- a/kernel/model/session.go
+++ b/kernel/model/session.go
@@ -28,6 +28,7 @@ import (
"github.com/88250/gulu"
"github.com/gin-gonic/gin"
+ "github.com/gorilla/websocket"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/util"
"github.com/steambap/captcha"
@@ -325,6 +326,11 @@ var (
)
func ControlConcurrency(c *gin.Context) {
+ if websocket.IsWebSocketUpgrade(c.Request) {
+ c.Next()
+ return
+ }
+
requestingLock.Lock()
mutex := requesting[c.Request.URL.Path]
if nil == mutex {